import type { Meta, StoryObj } from '@storybook/nextjs' import { useEffect } from 'react' import type { ComponentProps } from 'react' import AudioBtn from '.' import { ensureMockAudioManager } from '../../../../.storybook/utils/audio-player-manager.mock' ensureMockAudioManager() const StoryWrapper = (props: ComponentProps) => { useEffect(() => { ensureMockAudioManager() }, []) return (
Audio toggle using ActionButton styling
) } const meta = { title: 'Base/General/NewAudioButton', component: AudioBtn, tags: ['autodocs'], parameters: { layout: 'centered', docs: { description: { component: 'Updated audio playback trigger styled with `ActionButton`. Behaves like the legacy audio button but adopts the new button design system.', }, }, nextjs: { appDirectory: true, navigation: { pathname: '/apps/demo-app/text-to-audio', params: { appId: 'demo-app' }, }, }, }, argTypes: { id: { control: 'text', description: 'Message identifier used by the audio request.', }, value: { control: 'text', description: 'Prompt or response text that will be converted to speech.', }, voice: { control: 'text', description: 'Voice profile for the generated speech.', }, }, } satisfies Meta export default meta type Story = StoryObj export const Default: Story = { render: args => , args: { id: 'message-1', value: 'Listen to the latest assistant message.', voice: 'alloy', }, }