NotificationCard.stories.tsx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import type { Meta, StoryObj } from '@storybook/react-vite';
  2. import { Switch } from 'antd';
  3. import { BellOutlined } from '@ant-design/icons';
  4. import { NotificationCard } from './NotificationCard';
  5. const meta = {
  6. title: 'UI/Notifications/NotificationCard',
  7. component: NotificationCard,
  8. tags: ['autodocs'],
  9. parameters: {
  10. layout: 'padded',
  11. docs: {
  12. description: {
  13. component:
  14. 'Small outlined card that groups a notification channel — an icon and title in the header, a control in the top-right `extra` slot (typically a toggle), and the channel settings as its body.',
  15. },
  16. },
  17. },
  18. argTypes: {
  19. icon: { description: 'Leading icon shown before the title.' },
  20. title: { description: 'Channel name shown in the header.' },
  21. extra: { description: 'Top-right slot, typically an enable/disable Switch.' },
  22. children: { description: 'Card body — the channel settings.' },
  23. },
  24. } satisfies Meta<typeof NotificationCard>;
  25. export default meta;
  26. type Story = StoryObj<typeof meta>;
  27. export const Default: Story = {
  28. args: {
  29. icon: <BellOutlined />,
  30. title: 'Telegram',
  31. extra: <Switch defaultChecked aria-label="Enable Telegram notifications" />,
  32. children: <span>Push a message to the configured chat when an event fires.</span>,
  33. },
  34. };
  35. export const Disabled: Story = {
  36. args: {
  37. icon: <BellOutlined />,
  38. title: 'Email',
  39. extra: <Switch aria-label="Enable email notifications" />,
  40. children: <span>Email delivery is turned off for this channel.</span>,
  41. },
  42. };