2026-02-02 19:33:45 +00:00
|
|
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
|
|
|
import { NotificationItem } from './NotificationItem';
|
|
|
|
|
// Mocking the Notification type interface based on component usage
|
|
|
|
|
const mockNotification = {
|
|
|
|
|
id: '1',
|
|
|
|
|
type: 'like' as const,
|
|
|
|
|
read: false,
|
|
|
|
|
message: 'User X liked your post',
|
|
|
|
|
timestamp: '2m ago',
|
|
|
|
|
actionUrl: '/post/1',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const meta = {
|
2026-02-05 13:20:06 +00:00
|
|
|
title: 'Components/Features/Notifications/NotificationItem',
|
2026-02-02 19:33:45 +00:00
|
|
|
component: NotificationItem,
|
|
|
|
|
tags: ['autodocs'],
|
|
|
|
|
argTypes: {
|
|
|
|
|
onRead: { action: 'read' },
|
|
|
|
|
onAction: { action: 'action clicked' },
|
|
|
|
|
},
|
|
|
|
|
} satisfies Meta<typeof NotificationItem>;
|
|
|
|
|
|
|
|
|
|
export default meta;
|
|
|
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
|
|
|
|
|
|
export const Default: Story = {
|
|
|
|
|
args: {
|
|
|
|
|
notification: mockNotification,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const Read: Story = {
|
|
|
|
|
args: {
|
|
|
|
|
notification: { ...mockNotification, read: true },
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const Sale: Story = {
|
|
|
|
|
args: {
|
|
|
|
|
notification: {
|
|
|
|
|
...mockNotification,
|
|
|
|
|
type: 'sale',
|
|
|
|
|
message: 'You sold a track for $20!',
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const Security: Story = {
|
|
|
|
|
args: {
|
|
|
|
|
notification: {
|
|
|
|
|
...mockNotification,
|
|
|
|
|
type: 'security',
|
|
|
|
|
message: 'New login detected',
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|