|
1 | | -import { notFound } from 'next/navigation'; |
2 | | - |
3 | 1 | import { ActiveLink } from '@/components/link'; |
4 | 2 | import { TabLink } from '@/components/tab-links'; |
5 | 3 | import { TabLinks } from '@/components/tab-links'; |
6 | | -import { getDictionary, hasLocale } from '@/locales/dictionaries'; |
7 | | -import { LocaleProvider } from '@/providers/locale'; |
8 | 4 | import { ScrollArea, ScrollBar } from '@/ui/scroll-area'; |
9 | 5 |
|
10 | 6 | type Props = LayoutProps<'/[lang]/txns/[txn]'>; |
11 | 7 |
|
12 | 8 | const TxnLayout = async ({ children, params }: Props) => { |
13 | | - const { lang, txn } = await params; |
14 | | - |
15 | | - if (!hasLocale(lang)) notFound(); |
16 | | - |
17 | | - const dictionary = await getDictionary(lang, ['txns']); |
| 9 | + const { txn } = await params; |
18 | 10 |
|
19 | 11 | return ( |
20 | | - <LocaleProvider dictionary={dictionary} locale={lang}> |
21 | | - <main className="flex flex-1 flex-col pt-6 pb-10"> |
22 | | - <div className="container mx-auto px-4"> |
23 | | - <ScrollArea className="mb-3 w-full whitespace-nowrap"> |
24 | | - <TabLinks> |
25 | | - <TabLink asChild> |
26 | | - <ActiveLink href={`/txns/${txn}`}>Overview</ActiveLink> |
27 | | - </TabLink> |
28 | | - <TabLink asChild> |
29 | | - <ActiveLink href={`/txns/${txn}/execution`}> |
30 | | - Execution Plan |
31 | | - </ActiveLink> |
32 | | - </TabLink> |
33 | | - <TabLink asChild> |
34 | | - <ActiveLink href={`/txns/${txn}/enhanced`}> |
35 | | - Enhanced Plan |
36 | | - </ActiveLink> |
37 | | - </TabLink> |
38 | | - <TabLink asChild> |
39 | | - <ActiveLink href={`/txns/${txn}/tree`}>Tree Plan</ActiveLink> |
40 | | - </TabLink> |
41 | | - <TabLink asChild> |
42 | | - <ActiveLink href={`/txns/${txn}/receipts`}> |
43 | | - Receipts Summary |
44 | | - </ActiveLink> |
45 | | - </TabLink> |
46 | | - </TabLinks> |
47 | | - <ScrollBar orientation="horizontal" /> |
48 | | - </ScrollArea> |
49 | | - {children} |
50 | | - </div> |
51 | | - </main> |
52 | | - </LocaleProvider> |
| 12 | + <div className="container mx-auto px-4"> |
| 13 | + <ScrollArea className="mb-3 w-full whitespace-nowrap"> |
| 14 | + <TabLinks> |
| 15 | + <TabLink asChild> |
| 16 | + <ActiveLink href={`/txns/${txn}`}>Overview</ActiveLink> |
| 17 | + </TabLink> |
| 18 | + <TabLink asChild> |
| 19 | + <ActiveLink href={`/txns/${txn}/execution`}> |
| 20 | + Execution Plan |
| 21 | + </ActiveLink> |
| 22 | + </TabLink> |
| 23 | + {/* <TabLink asChild> |
| 24 | + <ActiveLink href={`/txns/${txn}/enhanced`}> |
| 25 | + Enhanced Plan |
| 26 | + </ActiveLink> |
| 27 | + </TabLink> |
| 28 | + <TabLink asChild> |
| 29 | + <ActiveLink href={`/txns/${txn}/tree`}>Tree Plan</ActiveLink> |
| 30 | + </TabLink> */} |
| 31 | + <TabLink asChild> |
| 32 | + <ActiveLink href={`/txns/${txn}/receipts`}> |
| 33 | + Receipts Summary |
| 34 | + </ActiveLink> |
| 35 | + </TabLink> |
| 36 | + </TabLinks> |
| 37 | + <ScrollBar orientation="horizontal" /> |
| 38 | + </ScrollArea> |
| 39 | + {children} |
| 40 | + </div> |
53 | 41 | ); |
54 | 42 | }; |
55 | 43 |
|
|
0 commit comments