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