Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions app/(main)/chat/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { useCallback, useEffect, useRef, useState } from "react";
import Sidebar from "@/app/components/Sidebar";
import PageHeader from "@/app/components/PageHeader";
import Button from "@/app/components/ui/Button";
import { useApp } from "@/app/lib/context/AppContext";
import { useAuth } from "@/app/lib/context/AuthContext";
import { useToast } from "@/app/hooks/useToast";
Expand Down Expand Up @@ -176,7 +177,7 @@
return null;
}

export default function ChatPage() {

Check warning on line 180 in app/(main)/chat/page.tsx

View workflow job for this annotation

GitHub Actions / lint-and-build

Function 'ChatPage' has a complexity of 22. Maximum allowed is 10

Check warning on line 180 in app/(main)/chat/page.tsx

View workflow job for this annotation

GitHub Actions / lint-and-build

Function 'ChatPage' has too many statements (36). Maximum allowed is 20
const { sidebarCollapsed } = useApp();
const { isAuthenticated, activeKey, isHydrated } = useAuth();
const apiKey = activeKey?.key ?? "";
Expand Down Expand Up @@ -237,7 +238,7 @@
);

const sendMessage = useCallback(
async (input: SendInput): Promise<string | null> => {

Check warning on line 241 in app/(main)/chat/page.tsx

View workflow job for this annotation

GitHub Actions / lint-and-build

Async arrow function has a complexity of 28. Maximum allowed is 10

Check warning on line 241 in app/(main)/chat/page.tsx

View workflow job for this annotation

GitHub Actions / lint-and-build

Async arrow function has too many statements (48). Maximum allowed is 20
if (
input.kind === "text" &&
!input.text.trim() &&
Expand Down Expand Up @@ -400,7 +401,7 @@
const textConfigReady =
!activeConfig || (activeConfig.type?.toLowerCase() ?? "text") !== "stt";

const handleStartVoice = useCallback(async () => {

Check warning on line 404 in app/(main)/chat/page.tsx

View workflow job for this annotation

GitHub Actions / lint-and-build

Async arrow function has too many statements (21). Maximum allowed is 20
if (!isAuthenticated) {
setShowLoginModal(true);
return;
Expand Down Expand Up @@ -461,13 +462,9 @@
subtitle="Ask anything - answers come from your selected configuration"
actions={
hasConversation ? (
<button
type="button"
onClick={handleNewChat}
className="px-3 py-1.5 rounded-full text-xs font-medium border border-border bg-bg-primary text-text-primary hover:bg-neutral-50 transition-colors cursor-pointer"
>
<Button onClick={handleNewChat} size="sm">
New chat
</button>
</Button>
) : null
}
/>
Expand Down
Loading