import type { Meta, StoryObj } from '@storybook/react'; import { ModernChatInput } from './ModernChatInput'; import React, { useState } from 'react'; const meta: Meta = { title: 'Assistant/ModernChatInput', component: ModernChatInput, parameters: { layout: 'centered', }, argTypes: { enableAudioInput: { control: 'boolean', description: 'Whether to show audio input (voice recording).', }, enableFileAttachment: { control: 'boolean', description: 'Whether to show the file attachment button.', }, enableDocumentCreation: { control: 'boolean', description: 'Whether to show the "Create document" action.', }, enablePodcastGeneration: { control: 'boolean', description: 'Whether to show the "Generate podcast" action.', }, enableSearch: { control: 'boolean', description: 'Whether to show the "Search" action.', }, }, }; export default meta; type Story = StoryObj; export const Default: Story = { render: args => { const [value, setValue] = useState(''); return (
{ alert(`Submitted: "${value}" ${action ? `with action: ${action}` : ''}`); setValue(''); }} onVoiceRecording={text => setValue(text)} />
); }, }; export const FullPage: Story = { args: { isFullPage: true, }, render: args => { const [value, setValue] = useState('I need help with the reports'); return (
setValue('')} />
); }, }; /** * Text-only input: all action buttons and extras are disabled. * Only the text input and send button remain. */ export const TextOnly: Story = { args: { enableAudioInput: false, enableFileAttachment: false, enableDocumentCreation: false, enablePodcastGeneration: false, enableSearch: false, }, render: args => { const [value, setValue] = useState(''); return (
setValue('')} />
); }, }; /** * Selective features: only document creation and search are enabled. */ export const SelectiveActions: Story = { args: { enableAudioInput: false, enableFileAttachment: false, enableDocumentCreation: true, enablePodcastGeneration: false, enableSearch: true, }, render: args => { const [value, setValue] = useState(''); return (
{ alert(`Submitted: "${value}" ${action ? `with action: ${action}` : ''}`); setValue(''); }} />
); }, };