import type { Meta, StoryObj } from '@storybook/react'; import { AudioPlayer } from './AudioPlayer'; import React, { useState } from 'react'; import { Button } from '../../ui/button'; const meta: Meta = { title: 'Media/AudioPlayer', component: AudioPlayer, parameters: { layout: 'fullscreen', }, }; export default meta; type Story = StoryObj; export const Card: Story = { args: { variant: 'card', src: 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3', title: 'Ambient Soundscape', artist: 'Nature Sounds Vol. 1', }, render: args => (
), }; export const GlobalBar: Story = { args: { variant: 'bar', isOpen: true, src: 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-2.mp3', title: 'Quarterly Results Briefing', subtitle: 'Podcast episode #42 • 15MB', }, render: args => { const [open, setOpen] = useState(args.isOpen); return (
setOpen(false)} />
); }, }; export const AutoFloat: Story = { args: { variant: 'card', src: 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-3.mp3', title: 'Floating Demo', artist: 'Scroll down to see it float', }, render: args => (

Play the audio and scroll down. The player will float to the corner automatically!

Scroll more...

Keep scrolling to trigger the floating behavior.

), }; export const PodcastStyle: Story = { args: { variant: 'bar', colorVariant: 'primary', isOpen: true, src: 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-8.mp3', title: 'Podcast: O Futuro da IA na UI', subtitle: 'Episódio 42 • 45 min permanecendo', }, render: args => { const [open, setOpen] = useState(args.isOpen); return (

Xertica Podcast

Experimente o novo player consolidado em modo "Branded".

setOpen(false)} />
); }, }; export const NoAutoFloat: Story = { args: { variant: 'card', enableAutoFloat: false, src: 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-4.mp3', title: 'Static Player', artist: 'This one will not float', }, render: args => (

Auto-float disabled via `enableAutoFloat={false}`.

), };