Files
stats/apps/web/src/app/(app)/[organizationId]/[projectId]/layout.tsx
Carl-Gerhard Lindesvärd 2f3c5ddf76 refactor packages
2024-02-19 10:55:15 +01:00

31 lines
670 B
TypeScript

import {
getCurrentOrganizations,
getDashboardsByOrganization,
} from '@mixan/db';
import { LayoutSidebar } from './layout-sidebar';
interface AppLayoutProps {
children: React.ReactNode;
params: {
organizationId: string;
};
}
export default async function AppLayout({
children,
params: { organizationId },
}: AppLayoutProps) {
const [organizations, dashboards] = await Promise.all([
getCurrentOrganizations(),
getDashboardsByOrganization(organizationId),
]);
return (
<div id="dashboard">
<LayoutSidebar {...{ organizations, dashboards }} />
<div className="lg:pl-72 transition-all">{children}</div>
</div>
);
}