stuff done
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import {Order} from '@prisma/client'
|
||||
import {useTranslations} from 'next-intl'
|
||||
|
||||
import {getOrdersByUserId} from '@/actions/admin/order'
|
||||
import {SignOutButton} from '@/components/auth/forms/sign-out-button'
|
||||
import CabinetButton from '@/components/shared/header/cabinet-button'
|
||||
import {type SingedInSession} from '@/lib/permission'
|
||||
@@ -11,7 +13,7 @@ import {
|
||||
} from '@/ui/collapsible'
|
||||
import {Separator} from '@/ui/separator'
|
||||
|
||||
export default function CabinetIndex({
|
||||
export default async function CabinetIndex({
|
||||
slug,
|
||||
session
|
||||
}: {
|
||||
@@ -19,6 +21,7 @@ export default function CabinetIndex({
|
||||
session: SingedInSession | null
|
||||
}) {
|
||||
const t = useTranslations('cabinet')
|
||||
const orders = await getOrdersByUserId(parseInt(session?.user.id as string))
|
||||
|
||||
return (
|
||||
<div className='my-8'>
|
||||
@@ -40,10 +43,24 @@ export default function CabinetIndex({
|
||||
{t('personal-information.title')}
|
||||
</h1>
|
||||
<Separator className='my-4' />
|
||||
{orders.map((order: Order) => (
|
||||
<div
|
||||
key={order.id}
|
||||
className='flex items-center justify-start gap-x-9 gap-y-6'
|
||||
>
|
||||
<div>{order.orderNo}</div>
|
||||
<div>
|
||||
{order.firstName} {order.surname}
|
||||
</div>
|
||||
<div>{order.phone}</div>
|
||||
<div>{order.email}</div>
|
||||
<div>{order.notes}</div>
|
||||
</div>
|
||||
))}
|
||||
{/*<BasicEditor placeholder={'type something'} />*/}
|
||||
{/*<Separator className='my-4' />*/}
|
||||
{slug ? <code>{slug[0]}</code> : <pre>{dump(session)}</pre>}
|
||||
<Collapsible>
|
||||
{/*{slug ? <code>{slug[0]}</code> : <pre>{dump(session)}</pre>}*/}
|
||||
{/*<Collapsible>
|
||||
<CollapsibleTrigger>
|
||||
Can I use this in my project?
|
||||
</CollapsibleTrigger>
|
||||
@@ -51,7 +68,7 @@ export default function CabinetIndex({
|
||||
Yes. Free to use for personal and commercial projects. No
|
||||
attribution required.
|
||||
</CollapsibleContent>
|
||||
</Collapsible>
|
||||
</Collapsible>*/}
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user