import { useState } from 'react'; import type { Meta, StoryObj } from '@storybook/react-webpack5'; import { useRtlDiffI18n, withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator'; import SegmentedControl from '../SegmentedControl'; export default { component: SegmentedControl, title: 'Forms/SegmentedControl/Tests', tags: ['!autodocs', '!manifest'], } satisfies Meta; type Story = StoryObj; type InteractiveSegmentedControlProps = { inputSegments: readonly { id: string; label: string; value: string }[]; viewSegments: readonly { id: string; label: string; value: string; controls: string }[]; }; function InteractiveSegmentedControl({ inputSegments, viewSegments, }: InteractiveSegmentedControlProps) { const [inputValue, setInputValue] = useState('one'); const [viewValue, setViewValue] = useState('beta'); return ( <> ); } export const RTLDiff: Story = { render: () => { const i18n = useRtlDiffI18n(); return ( ); }, ...withRTLDiff({ width: 'stretch', renderAs: 'iframe', i18n: { segmentOne: { en: 'One', ar: 'واحد' }, segmentTwo: { en: 'Two', ar: 'اثنان' }, segmentThree: { en: 'Three', ar: 'ثلاثة' }, segmentAlpha: { en: 'Alpha', ar: 'ألفا' }, segmentBeta: { en: 'Beta', ar: 'بيتا' }, segmentGamma: { en: 'Gamma', ar: 'غاما' }, }, }), };