diff --git a/src/components/admin/ConfirmDialog.stories.tsx b/src/components/admin/ConfirmDialog.stories.tsx new file mode 100644 index 0000000..96749e0 --- /dev/null +++ b/src/components/admin/ConfirmDialog.stories.tsx @@ -0,0 +1,46 @@ +import type { Meta, StoryObj } from '@storybook/react'; +import { fn } from '@storybook/test'; +import ConfirmDialog from './ConfirmDialog'; + +const meta = { + title: 'Admin/ConfirmDialog', + component: ConfirmDialog, + parameters: { + layout: 'centered', + }, + tags: ['autodocs'], + argTypes: { + onConfirm: { action: 'confirm' }, + onCancel: { action: 'cancel' }, + }, +} satisfies Meta; + +export default meta; +type Story = StoryObj; + +// Stories based on features.json storybookStories.ConfirmDialog +export const Default: Story = { + name: 'Default', + args: { + open: true, + title: 'Confirm Action', + message: 'Are you sure you want to proceed?', + confirmLabel: 'Confirm', + cancelLabel: 'Cancel', + onConfirm: fn(), + onCancel: fn(), + }, +}; + +export const DeleteWarning: Story = { + name: 'Delete Warning', + args: { + open: true, + title: 'Delete Item', + message: 'This action cannot be undone. Are you sure you want to delete this item?', + confirmLabel: 'Delete', + cancelLabel: 'Cancel', + onConfirm: fn(), + onCancel: fn(), + }, +}; diff --git a/src/components/admin/ConfirmDialog.tsx b/src/components/admin/ConfirmDialog.tsx index aab7bd7..d503469 100644 --- a/src/components/admin/ConfirmDialog.tsx +++ b/src/components/admin/ConfirmDialog.tsx @@ -1,13 +1,13 @@ 'use client'; import { - Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, } from '@mui/material'; +import Button from '../atoms/Button'; type ConfirmDialogProps = { open: boolean; @@ -35,10 +35,8 @@ export default function ConfirmDialog({ {message} - - +