refactor(web): split ChatView into chat-view module

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
senke 2026-02-07 03:59:32 +01:00
parent d56cf96900
commit 43d0d7e129
6 changed files with 55 additions and 22 deletions

View file

@ -1,21 +1,26 @@
import type { Meta, StoryObj } from '@storybook/react';
import { ChatView } from './ChatView';
import { ChatView, ChatViewSkeleton } from './chat-view';
const meta: Meta<typeof ChatView> = {
title: 'Components/Features/Views/ChatView',
component: ChatView,
parameters: { layout: 'fullscreen' },
tags: ['autodocs'],
decorators: [
(Story) => (
<div className="bg-kodo-background min-h-screen">
<Story />
</div>
),
],
title: 'Components/Features/Views/ChatView',
component: ChatView,
parameters: { layout: 'fullscreen' },
tags: ['autodocs'],
decorators: [
(Story) => (
<div className="bg-kodo-background min-h-layout-page">
<Story />
</div>
),
],
};
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = { name: 'Par défaut' };
export const Loading: Story = {
render: () => <ChatViewSkeleton />,
name: 'Chargement',
};

View file

@ -1,10 +1 @@
import React from 'react';
import { ChatInterface } from '@/features/chat/components/ChatInterface';
export const ChatView: React.FC = () => {
return (
<div className="h-[calc(100vh-6rem)]">
<ChatInterface />
</div>
);
};
export { ChatView } from './chat-view';

View file

@ -0,0 +1,11 @@
import React from 'react';
import { ChatInterface } from '@/features/chat/components/ChatInterface';
import type { ChatViewProps } from './types';
export function ChatView({ className }: ChatViewProps = {}) {
return (
<div className={className ?? 'min-h-layout-main'}>
<ChatInterface />
</div>
);
}

View file

@ -0,0 +1,19 @@
import React from 'react';
import { Skeleton } from '@/components/ui/skeleton';
export function ChatViewSkeleton() {
return (
<div className="min-h-layout-main flex flex-col p-4 space-y-4">
<div className="flex items-center gap-2 pb-2 border-b border-kodo-steel/50">
<Skeleton className="h-8 w-8 rounded-full" />
<Skeleton className="h-5 w-32" />
</div>
<div className="flex-1 space-y-2">
{[1, 2, 3, 4, 5].map((i) => (
<Skeleton key={i} className="h-14 w-full max-w-md rounded-xl" />
))}
</div>
<Skeleton className="h-12 w-full rounded-xl" />
</div>
);
}

View file

@ -0,0 +1,3 @@
export { ChatView } from './ChatView';
export { ChatViewSkeleton } from './ChatViewSkeleton';
export type { ChatViewProps } from './types';

View file

@ -0,0 +1,4 @@
export interface ChatViewProps {
/** Optional className for the container. */
className?: string;
}