Files
myeasycms-v2/apps/web/app/(dashboard)/home/[account]/layout.tsx
giancarlo 35ef90b4f8 Update Supabase dependency, delete cookie handling, create logger
Updated Supabase dependency across multiple packages from "^2.41.1" to "^2.42.0". Removed files handling sidebar state and theme cookies. Created a new Logger interface for managing log messages in the shared package. Enhanced the middleware to track accounts membership webhook payload. Minor adjustments were also made in multiple package.json files.
2024-04-03 23:59:41 +08:00

44 lines
878 B
TypeScript

import { use } from 'react';
import { Page } from '@kit/ui/page';
import { withI18n } from '~/lib/i18n/with-i18n';
import { AccountLayoutSidebar } from './_components/account-layout-sidebar';
import { loadTeamWorkspace } from './_lib/load-team-account-workspace';
interface Params {
account: string;
}
function TeamWorkspaceLayout({
children,
params,
}: React.PropsWithChildren<{
params: Params;
}>) {
const data = use(loadTeamWorkspace(params.account));
const accounts = data.accounts.map(({ name, slug, picture_url }) => ({
label: name,
value: slug,
image: picture_url,
}));
return (
<Page
sidebar={
<AccountLayoutSidebar
collapsed={false}
account={params.account}
accounts={accounts}
/>
}
>
{children}
</Page>
);
}
export default withI18n(TeamWorkspaceLayout);