build ok,
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import * as React from 'react';
|
||||
import type { Metadata } from 'next';
|
||||
|
||||
import { config } from '@/config';
|
||||
import { ThreadView } from '@/components/dashboard/chat/thread-view';
|
||||
import type { ThreadType } from '@/components/dashboard/chat/types';
|
||||
|
||||
export const metadata = { title: `Thread | Chat | Dashboard | ${config.site.name}` } satisfies Metadata;
|
||||
|
||||
interface PageProps {
|
||||
params: { threadId: string; threadType: ThreadType };
|
||||
}
|
||||
|
||||
export default function Page({ params }: PageProps): React.JSX.Element {
|
||||
const { threadId, threadType } = params;
|
||||
|
||||
return <ThreadView threadId={threadId} threadType={threadType} />;
|
||||
}
|
11
002_source/cms/src/app/dashboard/chat/compose/page.tsx
Normal file
11
002_source/cms/src/app/dashboard/chat/compose/page.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import * as React from 'react';
|
||||
import type { Metadata } from 'next';
|
||||
|
||||
import { config } from '@/config';
|
||||
import { ComposeView } from '@/components/dashboard/chat/compose-view';
|
||||
|
||||
export const metadata = { title: `Compose | Chat | Dashboard | ${config.site.name}` } satisfies Metadata;
|
||||
|
||||
export default function Page(): React.JSX.Element {
|
||||
return <ComposeView />;
|
||||
}
|
211
002_source/cms/src/app/dashboard/chat/layout.tsx
Normal file
211
002_source/cms/src/app/dashboard/chat/layout.tsx
Normal file
@@ -0,0 +1,211 @@
|
||||
import * as React from 'react';
|
||||
|
||||
import { dayjs } from '@/lib/dayjs';
|
||||
import { ChatProvider } from '@/components/dashboard/chat/chat-context';
|
||||
import { ChatView } from '@/components/dashboard/chat/chat-view';
|
||||
import type { Contact, Message, Thread } from '@/components/dashboard/chat/types';
|
||||
|
||||
const contacts = [
|
||||
{
|
||||
id: 'USR-010',
|
||||
name: 'Alcides Antonio',
|
||||
avatar: '/assets/avatar-10.png',
|
||||
isActive: false,
|
||||
lastActivity: dayjs().subtract(1, 'hour').toDate(),
|
||||
},
|
||||
{
|
||||
id: 'USR-003',
|
||||
name: 'Carson Darrin',
|
||||
avatar: '/assets/avatar-3.png',
|
||||
isActive: false,
|
||||
lastActivity: dayjs().subtract(15, 'minute').toDate(),
|
||||
},
|
||||
{ id: 'USR-005', name: 'Fran Perez', avatar: '/assets/avatar-5.png', isActive: true, lastActivity: dayjs().toDate() },
|
||||
{ id: 'USR-006', name: 'Iulia Albu', avatar: '/assets/avatar-6.png', isActive: true, lastActivity: dayjs().toDate() },
|
||||
{ id: 'USR-008', name: 'Jie Yan', avatar: '/assets/avatar-8.png', isActive: true, lastActivity: dayjs().toDate() },
|
||||
{
|
||||
id: 'USR-009',
|
||||
name: 'Marcus Finn',
|
||||
avatar: '/assets/avatar-9.png',
|
||||
isActive: false,
|
||||
lastActivity: dayjs().subtract(2, 'hour').toDate(),
|
||||
},
|
||||
{
|
||||
id: 'USR-001',
|
||||
name: 'Miron Vitold',
|
||||
avatar: '/assets/avatar-1.png',
|
||||
isActive: true,
|
||||
lastActivity: dayjs().toDate(),
|
||||
},
|
||||
{
|
||||
id: 'USR-007',
|
||||
name: 'Nasimiyu Danai',
|
||||
avatar: '/assets/avatar-7.png',
|
||||
isActive: true,
|
||||
lastActivity: dayjs().toDate(),
|
||||
},
|
||||
{
|
||||
id: 'USR-011',
|
||||
name: 'Omar Darobe',
|
||||
avatar: '/assets/avatar-11.png',
|
||||
isActive: true,
|
||||
lastActivity: dayjs().toDate(),
|
||||
},
|
||||
{
|
||||
id: 'USR-004',
|
||||
name: 'Penjani Inyene',
|
||||
avatar: '/assets/avatar-4.png',
|
||||
isActive: false,
|
||||
lastActivity: dayjs().subtract(6, 'hour').toDate(),
|
||||
},
|
||||
{
|
||||
id: 'USR-002',
|
||||
name: 'Siegbert Gottfried',
|
||||
avatar: '/assets/avatar-2.png',
|
||||
isActive: true,
|
||||
lastActivity: dayjs().toDate(),
|
||||
},
|
||||
] satisfies Contact[];
|
||||
|
||||
const threads = [
|
||||
{
|
||||
id: 'TRD-004',
|
||||
type: 'direct',
|
||||
participants: [
|
||||
{ id: 'USR-000', name: 'Sofia Rivers', avatar: '/assets/avatar.png' },
|
||||
{ id: 'USR-003', name: 'Carson Darrin', avatar: '/assets/avatar-3.png' },
|
||||
],
|
||||
unreadCount: 0,
|
||||
},
|
||||
{
|
||||
id: 'TRD-003',
|
||||
type: 'direct',
|
||||
participants: [
|
||||
{ id: 'USR-000', name: 'Sofia Rivers', avatar: '/assets/avatar.png' },
|
||||
{ id: 'USR-005', name: 'Fran Perez', avatar: '/assets/avatar-5.png' },
|
||||
],
|
||||
unreadCount: 1,
|
||||
},
|
||||
{
|
||||
id: 'TRD-002',
|
||||
type: 'group',
|
||||
participants: [
|
||||
{ id: 'USR-000', name: 'Sofia Rivers', avatar: '/assets/avatar.png' },
|
||||
{ id: 'USR-007', name: 'Nasimiyu Danai', avatar: '/assets/avatar-7.png' },
|
||||
{ id: 'USR-001', name: 'Miron Vitold', avatar: '/assets/avatar-1.png' },
|
||||
],
|
||||
unreadCount: 0,
|
||||
},
|
||||
{
|
||||
id: 'TRD-001',
|
||||
type: 'direct',
|
||||
participants: [
|
||||
{ id: 'USR-000', name: 'Sofia Rivers', avatar: '/assets/avatar.png' },
|
||||
{ id: 'USR-010', name: 'Alcides Antonio', avatar: '/assets/avatar-10.png' },
|
||||
],
|
||||
unreadCount: 2,
|
||||
},
|
||||
] satisfies Thread[];
|
||||
|
||||
const messages = [
|
||||
{
|
||||
id: 'MSG-011',
|
||||
threadId: 'TRD-004',
|
||||
type: 'text',
|
||||
content: 'Hi, how are you?',
|
||||
author: { id: 'USR-000', name: 'Sofia Rivers', avatar: '/assets/avatar.png' },
|
||||
createdAt: dayjs().subtract(10, 'minute').toDate(),
|
||||
},
|
||||
{
|
||||
id: 'MSG-010',
|
||||
threadId: 'TRD-003',
|
||||
type: 'text',
|
||||
content: 'Are you available for a call?',
|
||||
author: { id: 'USR-005', name: 'Fran Perez', avatar: '/assets/avatar-5.png' },
|
||||
createdAt: dayjs().subtract(5, 'minute').subtract(1, 'hour').toDate(),
|
||||
},
|
||||
{
|
||||
id: 'MSG-009',
|
||||
threadId: 'TRD-002',
|
||||
type: 'text',
|
||||
content: 'Hello everyone 😀',
|
||||
author: { id: 'USR-001', name: 'Miron Vitold', avatar: '/assets/avatar-1.png' },
|
||||
createdAt: dayjs().subtract(56, 'minute').subtract(2, 'hour').toDate(),
|
||||
},
|
||||
{
|
||||
id: 'MSG-008',
|
||||
threadId: 'TRD-002',
|
||||
type: 'text',
|
||||
content: 'Hi!',
|
||||
author: { id: 'USR-000', name: 'Sofia Rivers', avatar: '/assets/avatar.png' },
|
||||
createdAt: dayjs().subtract(51, 'minute').subtract(3, 'hour').toDate(),
|
||||
},
|
||||
{
|
||||
id: 'MSG-007',
|
||||
threadId: 'TRD-002',
|
||||
type: 'text',
|
||||
content: 'Hey, would you like to collaborate?',
|
||||
author: { id: 'USR-007', name: 'Nasimiyu Danai', avatar: '/assets/avatar-7.png' },
|
||||
createdAt: dayjs().subtract(46, 'minute').subtract(5, 'hour').toDate(),
|
||||
},
|
||||
{
|
||||
id: 'MSG-006',
|
||||
threadId: 'TRD-001',
|
||||
type: 'image',
|
||||
content: '/assets/image-abstract-1.png',
|
||||
author: { id: 'USR-010', name: 'Alcides Antonio', avatar: '/assets/avatar-10.png' },
|
||||
createdAt: dayjs().subtract(1, 'hour').subtract(2, 'day').toDate(),
|
||||
},
|
||||
{
|
||||
id: 'MSG-005',
|
||||
threadId: 'TRD-001',
|
||||
type: 'text',
|
||||
content: 'Ok, I will think about it. Thanks!',
|
||||
author: { id: 'USR-010', name: 'Alcides Antonio', avatar: '/assets/avatar-10.png' },
|
||||
createdAt: dayjs().subtract(2, 'hour').subtract(2, 'day').toDate(),
|
||||
},
|
||||
{
|
||||
id: 'MSG-004',
|
||||
threadId: 'TRD-001',
|
||||
type: 'text',
|
||||
content: "I'm sorry, I can't go lower than $45.",
|
||||
author: { id: 'USR-000', name: 'Sofia Rivers', avatar: '/assets/avatar.png' },
|
||||
createdAt: dayjs().subtract(3, 'hour').subtract(3, 'day').toDate(),
|
||||
},
|
||||
{
|
||||
id: 'MSG-003',
|
||||
threadId: 'TRD-001',
|
||||
type: 'text',
|
||||
content: "Can't you make it $40? I'm on a tight budget.",
|
||||
author: { id: 'USR-010', name: 'Alcides Antonio', avatar: '/assets/avatar-10.png' },
|
||||
createdAt: dayjs().subtract(5, 'hour').subtract(3, 'day').toDate(),
|
||||
},
|
||||
{
|
||||
id: 'MSG-002',
|
||||
threadId: 'TRD-001',
|
||||
type: 'text',
|
||||
content: 'Sure, it is $50 per hour.',
|
||||
author: { id: 'USR-000', name: 'Sofia Rivers', avatar: '/assets/avatar.png' },
|
||||
createdAt: dayjs().subtract(2, 'hour').subtract(4, 'day').toDate(),
|
||||
},
|
||||
{
|
||||
id: 'MSG-001',
|
||||
threadId: 'TRD-001',
|
||||
type: 'text',
|
||||
content: "I'm interested in your services, can you tell me more about your hourly rate?",
|
||||
author: { id: 'USR-010', name: 'Alcides Antonio', avatar: '/assets/avatar-10.png' },
|
||||
createdAt: dayjs().subtract(5, 'hour').subtract(4, 'day').toDate(),
|
||||
},
|
||||
] satisfies Message[];
|
||||
|
||||
interface LayoutProps {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
export default function Layout({ children }: LayoutProps): React.JSX.Element {
|
||||
return (
|
||||
<ChatProvider contacts={contacts} messages={messages} threads={threads}>
|
||||
<ChatView>{children}</ChatView>
|
||||
</ChatProvider>
|
||||
);
|
||||
}
|
32
002_source/cms/src/app/dashboard/chat/page.tsx
Normal file
32
002_source/cms/src/app/dashboard/chat/page.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import * as React from 'react';
|
||||
import type { Metadata } from 'next';
|
||||
import Box from '@mui/material/Box';
|
||||
import Stack from '@mui/material/Stack';
|
||||
import Typography from '@mui/material/Typography';
|
||||
|
||||
import { config } from '@/config';
|
||||
|
||||
export const metadata = { title: `Chat | Dashboard | ${config.site.name}` } satisfies Metadata;
|
||||
|
||||
export default function Page(): React.JSX.Element {
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
alignItems: 'center',
|
||||
display: 'flex',
|
||||
flex: '1 1 auto',
|
||||
flexDirection: 'column',
|
||||
justifyContent: 'center',
|
||||
overflowY: 'auto',
|
||||
p: 3,
|
||||
}}
|
||||
>
|
||||
<Stack spacing={2} sx={{ alignItems: 'center' }}>
|
||||
<Box component="img" src="/assets/not-found.svg" sx={{ height: 'auto', maxWidth: '100%', width: '120px' }} />
|
||||
<Typography color="text.secondary" sx={{ textAlign: 'center' }} variant="subtitle1">
|
||||
Start meaningful conversations!
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Box>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user