import type { Meta, StoryObj } from 'storybook-solidjs-vite'; import { createSignal } from 'solid-js'; import { ChatConfig, Empty, EmptyHeader, EmptyMedia, EmptyTitle, EmptyDescription, EmptyContent, PromptSuggestion, PromptInput, PromptInputTextarea, PromptInputActions, Button, } from '../index'; import { Sparkles, Plus, Globe, ArrowUp } from 'lucide-solid'; const meta: Meta = { title: 'Patterns/Empty State', parameters: { layout: 'centered', docs: { description: { component: 'The new-chat zero state: a centered greeting with starter suggestions above the composer. Composed from `Empty` (+ `EmptyMedia`/`EmptyTitle`/`EmptyDescription`), `PromptSuggestion` chips, and `PromptInput`. Clicking a suggestion fills the composer.', }, }, }, }; export default meta; type Story = StoryObj; const SUGGESTIONS = [ 'Summarize a document', 'Draft a product update', 'Explain a code snippet', 'Plan my week', ]; export const NewChat: Story = { render: () => { const [input, setInput] = createSignal(''); return (
How can I help today? Ask anything, or start from one of these.
{SUGGESTIONS.map((s) => ( setInput(s)}>{s} ))}
setInput('')}>
); }, };