import type { Meta, StoryObj } from '@storybook/react'; import React from 'react'; import MessageInput from './MessageInput'; import ReplyMessagePreview from './ReplyMessagePreview/ReplyMessagePreview'; import { Stubs } from '../../../Data/Stubs'; const meta: Meta = { title: '@quickblox-react-ui-kit/Presentation/ui-components/MessageInput', component: MessageInput, tags: ['autodocs'], parameters: { layout: 'centered', }, argTypes: { rephrase: { control: false, }, value: { control: 'text', description: 'Input value', }, onChange: { action: 'changed', description: 'Change event handler', }, onSend: { action: 'sent', description: 'Send event handler', }, enableVoice: { control: 'boolean', description: 'Enable voice message option', }, onVoice: { action: 'voice activated', description: 'Voice event handler', }, disableAttachment: { control: 'boolean', description: 'Disable attachment option', }, onAttachment: { action: 'attachment added', description: 'Attachment event handler', }, loading: { control: 'boolean', description: 'Enable loading state', }, previewMessage: { description: 'Last message by type', control: 'select', options: ['Text', 'Image', 'Video', 'Audio', 'None'], mapping: { Text: ( { console.log('closed'); }} /> ), Image: ( { console.log('closed'); }} /> ), Video: ( { console.log('closed'); }} /> ), Audio: ( { console.log('closed'); }} /> ), None: undefined, }, }, className: { control: 'text', description: 'CSS class', }, }, }; export default meta; export const MessageInputDefault: StoryObj = { name: 'MessageInput Default', args: { value: '', enableVoice: true, disableAttachment: false, loading: false, }, }; export const MessageInputWithVoiceMessage: StoryObj = { name: 'MessageInput With Voice Message', args: { ...MessageInputDefault.args, enableVoice: true, onVoice: () => { } }, }; export const MessageInputWithPreview: StoryObj = { name: 'MessageInput With Preview', args: { ...MessageInputDefault.args, previewMessage: ( { console.log('closed'); }} /> ), }, }; export const MessageInputLoadingState: StoryObj = { name: 'MessageInput Loading State', args: { ...MessageInputDefault.args, loading: true, }, };