import { IconSparkles, IconSearch, IconFilePlus, IconEdit, IconFileText, } from "@tabler/icons-react"; import { useTranslation } from "react-i18next"; import { useAtomValue } from "jotai"; import { workspaceAtom } from "@/features/user/atoms/current-user-atom.ts"; import { useRef } from "react"; import ChatInput, { ChatInputHandle } from "./chat-input"; import type { ChatAttachment, PageMention } from "../types/ai-chat.types"; import classes from "../styles/ai-chat.module.css"; type Suggestion = { icon: React.ReactNode; text: string; prompt: string; write?: boolean; }; const SUGGESTIONS: Suggestion[] = [ { icon: , text: "Search across all pages", prompt: "Search for pages about ", }, { icon: , text: "Create a new page", prompt: "Create a new page titled ", write: true, }, { icon: , text: "Summarize a page", prompt: "Summarize the page @", }, { icon: , text: "Update page content", prompt: "Update the page @", write: true, }, ]; type Props = { isStreaming: boolean; onSend: (content: string, mentions: PageMention[], attachments: ChatAttachment[]) => void; onStop: () => void; }; export default function ChatEmptyState({ isStreaming, onSend, onStop }: Props) { const { t } = useTranslation(); const workspace = useAtomValue(workspaceAtom); const writesDisabled = workspace?.settings?.ai?.chatReadOnly === true; const inputRef = useRef(null); const handleSuggestionClick = (prompt: string) => { inputRef.current?.prefill(prompt); }; return (
{t("Docmost AI")}

{t("What can I help you with?")}

{t("Get started")}

{SUGGESTIONS.filter((s) => !writesDisabled || !s.write).map((s) => ( ))}
); }