2026-02-03 08:56:11 +00:00
|
|
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
|
|
|
import { VirtualizedChatMessages } from './VirtualizedChatMessages';
|
|
|
|
|
|
|
|
|
|
const meta: Meta<typeof VirtualizedChatMessages> = {
|
2026-02-05 13:20:06 +00:00
|
|
|
title: 'Components/Features/Chat/VirtualizedChatMessages',
|
2026-02-03 08:56:11 +00:00
|
|
|
component: VirtualizedChatMessages,
|
|
|
|
|
parameters: { layout: 'padded' },
|
|
|
|
|
tags: ['autodocs'],
|
|
|
|
|
decorators: [
|
|
|
|
|
(Story) => (
|
|
|
|
|
<div className="bg-kodo-background p-4 min-h-screen">
|
|
|
|
|
<Story />
|
|
|
|
|
</div>
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default meta;
|
|
|
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
|
|
2026-02-05 13:20:06 +00:00
|
|
|
const mockMessages = [
|
|
|
|
|
{
|
|
|
|
|
id: '1',
|
|
|
|
|
content: 'Hello world',
|
|
|
|
|
sender: { username: 'User1' },
|
|
|
|
|
created_at: new Date().toISOString(),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: '2',
|
|
|
|
|
content: 'Hi there!',
|
|
|
|
|
sender: { username: 'User2' },
|
|
|
|
|
created_at: new Date().toISOString(),
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
export const Default: Story = {
|
|
|
|
|
name: 'Par défaut',
|
|
|
|
|
args: {
|
|
|
|
|
messages: mockMessages,
|
|
|
|
|
hasNextPage: false,
|
|
|
|
|
isFetching: false,
|
|
|
|
|
fetchNextPage: () => { },
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const Loading: Story = {
|
|
|
|
|
name: 'Chargement',
|
|
|
|
|
args: {
|
|
|
|
|
messages: [],
|
|
|
|
|
hasNextPage: false,
|
|
|
|
|
isFetching: true,
|
|
|
|
|
fetchNextPage: () => { },
|
|
|
|
|
},
|
|
|
|
|
};
|