Skip to content

Commit ae98c67

Browse files
committed
lint
1 parent f83b27f commit ae98c67

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

apps/portal/src/app/knowledge-base/sidebar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ export const sidebar: SideBar = {
7272
},
7373
{
7474
name: "Transfer Amount Exceeds Allowance",
75-
href: "/knowledge-base/troubleshoot/contracts/erc20-transfer-allowance"
76-
}
75+
href: "/knowledge-base/troubleshoot/contracts/erc20-transfer-allowance",
76+
},
7777
],
7878
},
7979
],

apps/portal/src/app/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import { Grid, Heading, SDKCard } from "@/components/Document";
2+
import { Button } from "@/components/ui/button";
3+
import { MessageCircleIcon } from "lucide-react";
24
import Image from "next/image";
35
import Link from "next/link";
46
import { UnityIcon } from "../icons";
@@ -15,8 +17,6 @@ import { PlaygroundIcon } from "../icons/products/PlaygroundIcon";
1517
import { cn } from "../lib/utils";
1618
import DocsHeroDark from "./_images/docs-hero-dark.png";
1719
import DocsHeroLight from "./_images/docs-hero-light.png";
18-
import { Button } from "@/components/ui/button";
19-
import { MessageCircleIcon } from "lucide-react";
2020
export default function Page() {
2121
return (
2222
<main className="container max-w-[900px] grow pb-20" data-noindex>
@@ -42,7 +42,7 @@ function Hero() {
4242
<p className="mb-8 max-w-md text-lg text-muted-foreground leading-normal">
4343
Development framework for building onchain apps, games, and agents.
4444
</p>
45-
45+
4646
<Link href="/chat">
4747
<Button className="flex items-center gap-2">
4848
<MessageCircleIcon className="size-4" />
@@ -236,4 +236,4 @@ function ArticleCardIndex(props: {
236236
</div>
237237
</Link>
238238
);
239-
}
239+
}

apps/portal/src/components/AI/api.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,10 @@ export const sendFeedback = async (
5656
},
5757
body: JSON.stringify({ conversationId, feedbackRating }),
5858
});
59-
59+
6060
if (!response.ok) {
6161
const error = await response.text();
62-
throw new Error(
63-
`Failed to send feedback: ${response.status} - ${error}`,
64-
);
62+
throw new Error(`Failed to send feedback: ${response.status} - ${error}`);
6563
}
6664
return true;
6765
} catch (error) {

apps/portal/src/components/AI/chat.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import { MarkdownRenderer } from "@/components/markdown/MarkdownRenderer";
44
import { LoadingDots } from "@/components/ui/LoadingDots";
55
import { Button } from "@/components/ui/button";
66
import { AutoResizeTextarea } from "@/components/ui/textarea";
7+
import siwaIcon from "@/icons/siwa-icon.png";
78
import { cn } from "@/lib/utils";
8-
import { ArrowUpIcon, ThumbsUpIcon, ThumbsDownIcon } from "lucide-react";
9+
import { ArrowUpIcon, ThumbsDownIcon, ThumbsUpIcon } from "lucide-react";
910
import { usePostHog } from "posthog-js/react";
1011
import {
1112
type ChangeEvent,
@@ -16,7 +17,6 @@ import {
1617
useState,
1718
} from "react";
1819
import { getChatResponse, sendFeedback } from "./api";
19-
import siwaIcon from "@/icons/siwa-icon.png";
2020

2121
interface Message {
2222
id: string;
@@ -142,9 +142,9 @@ export function Chat() {
142142
});
143143
}
144144
}, 100);
145-
145+
146146
return () => clearTimeout(timer);
147-
}, [messages]);
147+
}, []);
148148

149149
const handleInputChange = (e: ChangeEvent<HTMLTextAreaElement>) => {
150150
setInput(e.target.value);
@@ -161,15 +161,15 @@ export function Chat() {
161161

162162
const handleFeedback = async (messageId: string, feedback: 1 | -1) => {
163163
if (!conversationId) return; // Don't send feedback if no conversation
164-
164+
165165
try {
166166
await sendFeedback(conversationId, feedback);
167167
setMessages((prevMessages) =>
168168
prevMessages.map((msg) =>
169-
msg.id === messageId ? { ...msg, feedback } : msg
170-
)
169+
msg.id === messageId ? { ...msg, feedback } : msg,
170+
),
171171
);
172-
} catch (e) {
172+
} catch (_e) {
173173
// Optionally handle error
174174
}
175175
};
@@ -211,19 +211,21 @@ export function Chat() {
211211
type={message.role}
212212
/>
213213
{message.role === "assistant" && !message.isLoading && (
214-
<div className="flex gap-2 mt-2">
214+
<div className="mt-2 flex gap-2">
215215
{!message.feedback && (
216216
<>
217217
<button
218+
type="button"
218219
aria-label="Thumbs up"
219-
className="hover:text-green-500 transition-colors text-muted-foreground"
220+
className="text-muted-foreground transition-colors hover:text-green-500"
220221
onClick={() => handleFeedback(message.id, 1)}
221222
>
222223
<ThumbsUpIcon className="size-5" />
223224
</button>
224225
<button
226+
type="button"
225227
aria-label="Thumbs down"
226-
className="hover:text-red-500 transition-colors text-muted-foreground"
228+
className="text-muted-foreground transition-colors hover:text-red-500"
227229
onClick={() => handleFeedback(message.id, -1)}
228230
>
229231
<ThumbsDownIcon className="size-5" />

0 commit comments

Comments
 (0)