split-button.stories.tsx 888 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import { SplitButton } from '@/features/ui/components/bootstrap-5/split-button'
  2. import type { Meta } from '@storybook/react'
  3. import { useTranslation } from 'react-i18next'
  4. type Args = React.ComponentProps<typeof SplitButton>
  5. export const Dropdown = (args: Args) => {
  6. const { t } = useTranslation()
  7. return <SplitButton accessibilityLabel={t('expand')} {...args} />
  8. }
  9. const meta: Meta<typeof SplitButton> = {
  10. title: 'Shared/Components/Bootstrap 5/SplitButton',
  11. component: SplitButton,
  12. args: {
  13. align: { sm: 'start' },
  14. id: 'split-button',
  15. items: [
  16. { eventKey: '1', label: 'Action 1' },
  17. { eventKey: '2', label: 'Action 2' },
  18. { eventKey: '3', label: 'Action 3' },
  19. ],
  20. text: 'Split Button',
  21. },
  22. argTypes: {
  23. id: {
  24. table: {
  25. disable: true,
  26. },
  27. },
  28. },
  29. parameters: {
  30. bootstrap5: true,
  31. },
  32. }
  33. export default meta