Files
planflow/src/app/layout.tsx
T
Claude a24c1b821c Add the application shell, Aperçu and the week grid
Ports the shell and Aperçu screen from the Claude Design export, and
builds the week grid from the design system's grid specification.

The theme is applied by a nonced inline script before first paint.
Without it the page renders light and then swaps, which is a white
flash for anyone working in dark. The nonce our CSP already emits is
what makes an inline script possible at all.

Demo data lives in src/lib/demo behind a README stating it is fictional
and replaceable. Screens import from there and nowhere else, so the
directory can be deleted wholesale once real queries land.

Weekend columns are shaded because in retail those are the days that
carry counterparts — mayor-authorised Sundays and their compensatory
rest — and scheduling one by accident is the failure worth preventing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cr9dkEHwbDgkWPnyGj1Rjv
2026-08-07 22:12:23 +00:00

33 lines
905 B
TypeScript

import type { Metadata } from 'next';
import { headers } from 'next/headers';
import { THEME_INIT_SCRIPT } from '@/components/shell/ThemeToggle';
import './globals.css';
export const metadata: Metadata = {
title: 'PlanFlow',
description: 'Gestion du personnel, des plannings et des temps.',
};
export default async function RootLayout({
children,
}: Readonly<{ children: React.ReactNode }>) {
// Le nonce est posé par requête dans src/proxy.ts. C'est la seule façon
// d'exécuter un script inline sous notre CSP, qui n'autorise pas
// 'unsafe-inline'.
const nonce = (await headers()).get('x-nonce') ?? undefined;
return (
<html lang="fr" data-theme="light" suppressHydrationWarning>
<head>
<script
nonce={nonce}
dangerouslySetInnerHTML={{ __html: THEME_INIT_SCRIPT }}
/>
</head>
<body>{children}</body>
</html>
);
}