Skip to content

Commit

Permalink
story(AutoPlay): Add AutoPlay story
Browse files Browse the repository at this point in the history
  • Loading branch information
drikusroor committed Sep 27, 2024
1 parent e746348 commit 8a76f76
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions frontend/src/stories/AutoPlay.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import AutoPlay from '../components/Playback/Autoplay';

export default {
title: 'Components/AutoPlay',
component: AutoPlay,
argTypes: {
instruction: { control: 'text' },
showAnimation: { control: 'boolean' },
playSection: { action: 'playSection' },
startedPlaying: { action: 'startedPlaying' },
finishedPlaying: { action: 'finishedPlaying' },
responseTime: { control: 'number' },
className: { control: 'text' },
},
decorators: [
(Story) => (
<div className='aha__trial' style={{ padding: '3rem', background: '#333' }}>
<Story />
</div>
),
],
} as Meta;

const Template: Story = (args) => <AutoPlay {...args} />;

export const Default = Template.bind({});
Default.args = {
instruction: 'Listen to the audio',
showAnimation: true,
responseTime: 5000,
className: '',
};

export const WithoutAnimation = Template.bind({});
WithoutAnimation.args = {
...Default.args,
showAnimation: false,
};

export const LongResponseTime = Template.bind({});
LongResponseTime.args = {
...Default.args,
responseTime: 10000,
};

export const CustomInstruction = Template.bind({});
CustomInstruction.args = {
...Default.args,
instruction: 'This is a custom instruction for the AutoPlay component',
};

export const WithCustomClassName = Template.bind({});
WithCustomClassName.args = {
...Default.args,
className: 'custom-class',
};

0 comments on commit 8a76f76

Please sign in to comment.