veza/apps/web/src/features/chat/components/ChatSidebar.stories.tsx
senke 8cf22aa90c style(chat): elevate ChatSidebar and related stories to SaaS Premium
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-07 15:18:31 +01:00

53 lines
1.4 KiB
TypeScript

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) => (
<div className="w-80 min-h-layout-page border rounded-lg overflow-hidden bg-card border-border">
<Story />
</div>
),
],
} satisfies Meta<typeof ChatSidebar>;
export default meta;
type Story = StoryObj<typeof meta>;
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 },
),
),
],
},
},
};