wealth/apps/bull/src/app/(flow)/terms/layout.tsx

50 lines
1.8 KiB
TypeScript

// First: the static `metadata` below reads a server-only namespace, which the server bootstrap
// adds to i18n when this module loads, whichever module Next loads first (0055).
import '../../../bootstrap/bootstrap.server';
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { MobileTopBar } from '@lumina/market/app/navigation';
import { RulesTabs } from '@lumina/market/app/screens/(flow)/terms/organisms/rules-tabs';
import type { Metadata } from 'next';
import type { ReactNode } from 'react';
import { i18n } from '../../../i18n';
// Only the landing is indexed (0071); both tabs inherit this.
export const metadata: Metadata = {
title: i18n.t('rules:meta-title'),
description: i18n.t('rules:meta-description'),
robots: { index: false },
};
/**
* «قوانین لومینا» on mobile (G-2r): a task page pushed from حساب کاربری, checkout, a suspended card
* or the support sheet: back · «قوانین لومینا» · support, no bottom nav, then the tab row
* «قوانین عمومی» · «شرایط اشتراک». Each tab is its own route with its own loading, so the bar and
* the row stay while one loads; back returns to where the rules were opened.
*/
export default function RulesLayout({ children }: { children: ReactNode }) {
const t = i18n.getFixedT(null, 'rules');
return (
<FlexBox direction="flex-col" className="min-h-dvh bg-surface">
<MobileTopBar title={t('title')} />
<RulesTabs
layout="mobile"
labels={{
label: t('tabs.label'),
general: t('tabs.general'),
subscription: t('tabs.subscription'),
}}
/>
<FlexBox
tag="main"
direction="flex-col"
className="flex-1 px-4 pt-4 pb-8"
>
{children}
</FlexBox>
</FlexBox>
);
}