diff --git a/apps/web/src/components/views/ChatView.stories.tsx b/apps/web/src/components/views/ChatView.stories.tsx index cba73c935..fb033843b 100644 --- a/apps/web/src/components/views/ChatView.stories.tsx +++ b/apps/web/src/components/views/ChatView.stories.tsx @@ -1,21 +1,26 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { ChatView } from './ChatView'; +import { ChatView, ChatViewSkeleton } from './chat-view'; const meta: Meta = { - title: 'Components/Features/Views/ChatView', - component: ChatView, - parameters: { layout: 'fullscreen' }, - tags: ['autodocs'], - decorators: [ - (Story) => ( -
- -
- ), - ], + title: 'Components/Features/Views/ChatView', + component: ChatView, + parameters: { layout: 'fullscreen' }, + tags: ['autodocs'], + decorators: [ + (Story) => ( +
+ +
+ ), + ], }; export default meta; type Story = StoryObj; export const Default: Story = { name: 'Par défaut' }; + +export const Loading: Story = { + render: () => , + name: 'Chargement', +}; diff --git a/apps/web/src/components/views/ChatView.tsx b/apps/web/src/components/views/ChatView.tsx index 8b830b142..d763b76cf 100644 --- a/apps/web/src/components/views/ChatView.tsx +++ b/apps/web/src/components/views/ChatView.tsx @@ -1,10 +1 @@ -import React from 'react'; -import { ChatInterface } from '@/features/chat/components/ChatInterface'; - -export const ChatView: React.FC = () => { - return ( -
- -
- ); -}; +export { ChatView } from './chat-view'; diff --git a/apps/web/src/components/views/chat-view/ChatView.tsx b/apps/web/src/components/views/chat-view/ChatView.tsx new file mode 100644 index 000000000..62f01acc8 --- /dev/null +++ b/apps/web/src/components/views/chat-view/ChatView.tsx @@ -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 ( +
+ +
+ ); +} diff --git a/apps/web/src/components/views/chat-view/ChatViewSkeleton.tsx b/apps/web/src/components/views/chat-view/ChatViewSkeleton.tsx new file mode 100644 index 000000000..a968f7d64 --- /dev/null +++ b/apps/web/src/components/views/chat-view/ChatViewSkeleton.tsx @@ -0,0 +1,19 @@ +import React from 'react'; +import { Skeleton } from '@/components/ui/skeleton'; + +export function ChatViewSkeleton() { + return ( +
+
+ + +
+
+ {[1, 2, 3, 4, 5].map((i) => ( + + ))} +
+ +
+ ); +} diff --git a/apps/web/src/components/views/chat-view/index.ts b/apps/web/src/components/views/chat-view/index.ts new file mode 100644 index 000000000..153cb1b34 --- /dev/null +++ b/apps/web/src/components/views/chat-view/index.ts @@ -0,0 +1,3 @@ +export { ChatView } from './ChatView'; +export { ChatViewSkeleton } from './ChatViewSkeleton'; +export type { ChatViewProps } from './types'; diff --git a/apps/web/src/components/views/chat-view/types.ts b/apps/web/src/components/views/chat-view/types.ts new file mode 100644 index 000000000..e83b4c892 --- /dev/null +++ b/apps/web/src/components/views/chat-view/types.ts @@ -0,0 +1,4 @@ +export interface ChatViewProps { + /** Optional className for the container. */ + className?: string; +}