diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js index 53a87c7..050e89d 100644 --- a/frontend/eslint.config.js +++ b/frontend/eslint.config.js @@ -1,18 +1,15 @@ import js from "@eslint/js"; import globals from "globals"; -import reactHooks from "eslint-plugin-react-hooks"; // Or import { configs as reactHooks } from "eslint-plugin-react-hooks"; +import reactHooks from "eslint-plugin-react-hooks"; import reactRefresh from "eslint-plugin-react-refresh"; -import { defineConfig, globalIgnores } from "eslint/config"; -export default defineConfig([ - globalIgnores(["dist"]), +export default [ { - files: ["**/*{js,jsx}"], - extends: [ - js.configs.recommended, - reactHooks.configs["recommended-latest"], - reactRefresh.configs.vite, - ], + ignores: ["dist/**"], + }, + js.configs.recommended, + { + files: ["**/*.{js,jsx}"], languageOptions: { ecmaVersion: 2020, globals: globals.browser, @@ -22,8 +19,17 @@ export default defineConfig([ sourceType: "module", }, }, + plugins: { + "react-hooks": reactHooks, + "react-refresh": reactRefresh, + }, rules: { + ...reactHooks.configs.recommended.rules, + "react-refresh/only-export-components": [ + "warn", + { allowConstantExport: true }, + ], "no-unused-vars": ["error", { varsIgnorePattern: "^[A-Z_]" }], }, }, -]); +]; diff --git a/frontend/package-lock.json b/frontend/package-lock.json index aa53229..7dca15a 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -33,6 +33,7 @@ }, "devDependencies": { "@eslint/js": "^9.38.0", + "daisyui": "^5.4.7", "eslint": "^9.38.0", "eslint-plugin-import": "^2.32.0", "eslint-plugin-react": "^7.37.5", @@ -2906,6 +2907,16 @@ "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", "license": "MIT" }, + "node_modules/daisyui": { + "version": "5.4.7", + "resolved": "https://registry.npmjs.org/daisyui/-/daisyui-5.4.7.tgz", + "integrity": "sha512-2wYO61vTPCXk7xEBgnzLZAYoE0xS5IRLu/GSq0vORpB+cTrtubdx69NnA0loc0exvCY1s2fYL4lGZtFHe2ohNQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/saadeghi/daisyui?sponsor=1" + } + }, "node_modules/data-uri-to-buffer": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", diff --git a/frontend/package.json b/frontend/package.json index 5f5becb..b1476ae 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -40,6 +40,7 @@ "packageManager": ">=npm@10.9.0", "devDependencies": { "@eslint/js": "^9.38.0", + "daisyui": "^5.4.7", "eslint": "^9.38.0", "eslint-plugin-import": "^2.32.0", "eslint-plugin-react": "^7.37.5", diff --git a/frontend/src/components/layouts/chat-layout.jsx b/frontend/src/components/layouts/chat-layout.jsx index bbbdbdf..951d54c 100644 --- a/frontend/src/components/layouts/chat-layout.jsx +++ b/frontend/src/components/layouts/chat-layout.jsx @@ -1,4 +1,10 @@ -import React, { useCallback, useEffect, useMemo, useRef, useState } from "react"; +import React, { + useCallback, + useEffect, + useMemo, + useRef, + useState, +} from "react"; import ChatHeader from "src/components/ui/chat/chat-header"; import ChatWindow from "src/components/ui/chat/chat-window"; import MessageInput from "src/components/ui/chat/message-input"; @@ -10,7 +16,7 @@ import { } from "src/lib/api"; const createId = () => - (globalThis.crypto?.randomUUID?.() ?? `id-${Date.now()}-${Math.random()}`); + globalThis.crypto?.randomUUID?.() ?? `id-${Date.now()}-${Math.random()}`; const INTRO_MESSAGE = { id: "intro", @@ -176,8 +182,8 @@ export default function ChatLayout() { prev.map((message) => message.id === placeholderId ? { ...message, content, pending: false } - : message - ) + : message, + ), ); } catch (error) { const message = error?.message || "Something went wrong."; @@ -185,13 +191,13 @@ export default function ChatLayout() { prev.map((entry) => entry.id === placeholderId ? { - ...entry, - content: `⚠️ ${message}`, - pending: false, - error: true, - } - : entry - ) + ...entry, + content: `⚠️ ${message}`, + pending: false, + error: true, + } + : entry, + ), ); showError(message); } finally { @@ -206,7 +212,7 @@ export default function ChatLayout() { refreshFiles, waitForResult, buildAssistantMarkdown, - ] + ], ); const handleDeleteAll = useCallback(() => { diff --git a/frontend/src/index.css b/frontend/src/index.css index 2b88b1a..d513070 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -1,4 +1,5 @@ @import "tailwindcss"; +@import "daisyui"; .dark { --paragraph: 235, 236, 239;