webapp/src/components/Editor/MiniEditor.stories.tsx
Untone 8106bae0c2
Some checks failed
deploy / test (push) Failing after 1m15s
deploy / Update templates on Mailgun (push) Has been skipped
editor-refactored
2024-10-01 22:39:17 +03:00

65 lines
1.3 KiB
TypeScript

import { Meta, StoryObj } from 'storybook-solidjs'
import MiniEditor from './MiniEditor'
const meta: Meta<typeof MiniEditor> = {
title: 'Components/MiniEditor',
component: MiniEditor,
argTypes: {
content: {
control: 'text',
description: 'Initial content for the editor',
defaultValue: ''
},
limit: {
control: 'number',
description: 'Character limit for the editor',
defaultValue: 500
},
placeholder: {
control: 'text',
description: 'Placeholder text when the editor is empty',
defaultValue: 'Start typing here...'
},
onChange: {
action: 'changed',
description: 'Callback when the content changes'
}
}
}
export default meta
type Story = StoryObj<typeof MiniEditor>
export const Default: Story = {
args: {
content: '',
limit: 500,
placeholder: 'Start typing here...'
}
}
export const WithInitialContent: Story = {
args: {
content: 'This is some initial content',
limit: 500,
placeholder: 'Start typing here...'
}
}
export const WithCharacterLimit: Story = {
args: {
content: '',
limit: 50,
placeholder: 'You have a 50 character limit...'
}
}
export const WithCustomPlaceholder: Story = {
args: {
content: '',
limit: 500,
placeholder: 'Custom placeholder here...'
}
}