main
tsx 42 lines 1.07 KB
Raw
1 import { Boundary } from '@/app/_ui/boundary';
2 import { ClickCounter } from '@/app/_ui/click-counter';
3 import { TabGroup } from '@/app/_ui/tab-group';
4 import { getCategories } from '@/app/api/categories/getCategories';
5 import React from 'react';
6
7 export default async function Layout({
8 children,
9 }: {
10 children: React.ReactNode;
11 }) {
12 const categories = await getCategories();
13
14 return (
15 <Boundary labels={['shop layout']} color="cyan" animateRerendering={false}>
16 <div className="space-y-9">
17 <div className="flex justify-between">
18 <TabGroup
19 path="/play"
20 items={[
21 {
22 text: 'Home',
23 },
24 ...categories.map((x) => ({
25 text: x.name,
26 slug: x.slug,
27 })),
28 { text: 'Checkout', slug: 'checkout' },
29 { text: 'Blog', slug: 'blog' },
30 ]}
31 />
32
33 <div className="self-start">
34 <ClickCounter />
35 </div>
36 </div>
37
38 <div>{children}</div>
39 </div>
40 </Boundary>
41 );
42 }