Skip to content

Commit 2877ddf

Browse files
committed
ran prettier
1 parent 2d2fa7c commit 2877ddf

File tree

4 files changed

+45
-45
lines changed

4 files changed

+45
-45
lines changed

frontend/src/pages/Chat/components/InputField.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export default function InputField({
2626
const userMessageId = Date.now().toString();
2727
const botMessageId = (Date.now() + 1).toString();
2828

29-
3029
onChange({ target: { value: "" } } as React.ChangeEvent<HTMLInputElement>);
3130
setIsLoading(true);
3231

@@ -73,9 +72,9 @@ export default function InputField({
7372
prev.map((msg) =>
7473
msg.messageId === botMessageId
7574
? {
76-
...msg,
77-
content: "Sorry, I encountered an error. Please try again.",
78-
}
75+
...msg,
76+
content: "Sorry, I encountered an error. Please try again.",
77+
}
7978
: msg,
8079
),
8180
);

frontend/src/pages/Chat/components/MessageWindow.tsx

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,25 +63,28 @@ export default function MessageWindow({
6363
</div>
6464
) : (
6565
<div
66-
className={`max-h-[calc(100dvh-240px)] sm:max-h-[calc(100dvh-20rem)] mx-auto max-w-[700px] ${isOngoing ? "overflow-y-scroll" : "overflow-y-none"
67-
}`}
66+
className={`max-h-[calc(100dvh-240px)] sm:max-h-[calc(100dvh-20rem)] mx-auto max-w-[700px] ${
67+
isOngoing ? "overflow-y-scroll" : "overflow-y-none"
68+
}`}
6869
ref={messagesRef}
6970
>
7071
{isOngoing ? (
7172
<div className="flex flex-col gap-4">
7273
{messages.map((message) => (
7374
<div
74-
className={`flex w-full ${message.role === "assistant"
75-
? "justify-start"
76-
: "justify-end"
77-
}`}
75+
className={`flex w-full ${
76+
message.role === "assistant"
77+
? "justify-start"
78+
: "justify-end"
79+
}`}
7880
key={message.messageId}
7981
>
8082
<div
81-
className={`message-bubble p-3 rounded-2xl max-w-[95%] ${message.role === "assistant"
82-
? "bg-slate-200 rounded-tl-sm"
83-
: "bg-[#1F584F] text-white rounded-tr-sm"
84-
}`}
83+
className={`message-bubble p-3 rounded-2xl max-w-[95%] ${
84+
message.role === "assistant"
85+
? "bg-slate-200 rounded-tl-sm"
86+
: "bg-[#1F584F] text-white rounded-tr-sm"
87+
}`}
8588
>
8689
<MessageContent
8790
message={message}
@@ -108,7 +111,7 @@ export default function MessageWindow({
108111
setIsLoading={setIsLoading}
109112
inputRef={inputRef}
110113
value={inputValue}
111-
onChange={e => setInputValue(e.target.value)}
114+
onChange={(e) => setInputValue(e.target.value)}
112115
/>
113116
<div className="flex justify-center gap-4 mt-4">
114117
<button
@@ -124,9 +127,7 @@ export default function MessageWindow({
124127
</div>
125128
</>
126129
) : (
127-
128130
<CitySelectField setMessages={setMessages} />
129-
130131
)}
131132
</div>
132133
</>
Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
interface SuggestedPromptsProps {
2-
onPromptClick: (prompt: string) => void;
2+
onPromptClick: (prompt: string) => void;
33
}
44

55
const prompts = [
6-
"Do I qualify for a rental subsidy, such as Section 8/HomeForward?",
7-
"I have a leak in my roof. Help me address this with my landlord.",
8-
"I received an eviction notice for non-payment of rent. What should I do?",
9-
"I received a 'no-cause' eviction notice. How much money is my landlord required to pay me to move out?",
6+
"Do I qualify for a rental subsidy, such as Section 8/HomeForward?",
7+
"I have a leak in my roof. Help me address this with my landlord.",
8+
"I received an eviction notice for non-payment of rent. What should I do?",
9+
"I received a 'no-cause' eviction notice. How much money is my landlord required to pay me to move out?",
1010
];
1111

12-
export default function SuggestedPrompts({ onPromptClick }: SuggestedPromptsProps) {
13-
return (
14-
<div className=" items-center m-auto ">
15-
<div className=" flex flex-col gap-4 fade-in-up items-center ">
16-
{prompts.map((prompt, idx) => (
17-
<button
18-
key={idx}
19-
className="inline-flex px-4 border border-[#1f584f] rounded-4xl cursor-pointer py-1 font-medium sm:bg-white hover:bg-[#bac9b2] "
20-
onClick={() =>
21-
onPromptClick(
22-
Array.isArray(prompt) ? prompt.join(" ") : prompt
23-
)
24-
}
25-
type="button"
26-
>
27-
{prompt}
28-
</button>
29-
))}
30-
</div>
31-
</div>
32-
);
33-
}
12+
export default function SuggestedPrompts({
13+
onPromptClick,
14+
}: SuggestedPromptsProps) {
15+
return (
16+
<div className=" items-center m-auto ">
17+
<div className=" flex flex-col gap-4 fade-in-up items-center ">
18+
{prompts.map((prompt, idx) => (
19+
<button
20+
key={idx}
21+
className="inline-flex px-4 border border-[#1f584f] rounded-4xl cursor-pointer py-1 font-medium sm:bg-white hover:bg-[#bac9b2] "
22+
onClick={() =>
23+
onPromptClick(Array.isArray(prompt) ? prompt.join(" ") : prompt)
24+
}
25+
type="button"
26+
>
27+
{prompt}
28+
</button>
29+
))}
30+
</div>
31+
</div>
32+
);
33+
}

frontend/src/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ body {
5252
}
5353
.fade-in-up {
5454
animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1);
55-
}
55+
}

0 commit comments

Comments
 (0)