import type { Meta, StoryObj } from '@storybook/react';
import { http, HttpResponse } from 'msw';
import { ChatSidebar } from './ChatSidebar';
const meta = {
title: 'Components/Features/Chat/ChatSidebar',
component: ChatSidebar,
tags: ['autodocs'],
parameters: {
layout: 'centered',
},
decorators: [
(Story) => (
),
],
} satisfies Meta;
export default meta;
type Story = StoryObj;
export const Default: Story = {};
/** No conversations — empty state */
export const Empty: Story = {
parameters: {
msw: {
handlers: [
http.get('*/api/v1/conversations', () =>
HttpResponse.json({ success: true, data: [] }),
),
],
},
},
};
/** API error — error state with retry */
export const Error: Story = {
parameters: {
msw: {
handlers: [
http.get('*/api/v1/conversations', () =>
HttpResponse.json(
{ success: false, error: { message: 'Signal lost' } },
{ status: 500 },
),
),
],
},
},
};