import type { Meta, StoryObj } from '@storybook/react-webpack5'; import { useRtlDiffI18n, withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator'; import { Button, Modal } from '../..'; export default { component: Modal, title: 'Dialogs/Modal/Tests/RTL Diff', tags: ['!autodocs', '!manifest'], } satisfies Meta; type Story = StoryObj; export const WithTitleAndFooter: Story = { render: () => { const i18n = useRtlDiffI18n(); return ( {i18n.confirm} } onClose={() => {}} /> ); }, ...withRTLDiff({ renderAs: 'iframe', i18n: { title: { en: 'Modal title', ar: 'عنوان النافذة' }, body: { en: 'Body content for the modal dialog.', ar: 'محتوى النافذة الحوارية.' }, confirm: { en: 'Confirm', ar: 'تأكيد' }, }, }), }; export const WithoutFooter: Story = { render: () => { const i18n = useRtlDiffI18n(); return {}} />; }, ...withRTLDiff({ renderAs: 'iframe', i18n: { title: { en: 'Modal without footer', ar: 'نافذة بدون تذييل' }, body: { en: 'Body content without a footer.', ar: 'محتوى بدون تذييل.' }, }, }), }; export const WithoutTitle: Story = { render: () => { const i18n = useRtlDiffI18n(); return ( {i18n.done} } onClose={() => {}} /> ); }, ...withRTLDiff({ renderAs: 'iframe', i18n: { body: { en: 'Body content without a title.', ar: 'محتوى بدون عنوان.' }, done: { en: 'Done', ar: 'تم' }, }, }), };