Files
cal.diy/apps/web/app/(use-page-wrapper)/layout.tsx
T
Keith WilliamsandDevin AI 09f2aa113b fix: resolve lint warnings in web app (#26017)
* fix: resolve lint warnings in web app

Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>

* fix: remove unused isReadPermission variable

Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>

* fix: remove unused loading state entirely

Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2025-12-21 14:38:27 +00:00

41 lines
1.0 KiB
TypeScript

import { headers } from "next/headers";
import Script from "next/script";
import PageWrapper from "@components/PageWrapperAppDir";
export default async function PageWrapperLayout({ children }: { children: React.ReactNode }) {
const h = await headers();
const nonce = h.get("x-csp-nonce") ?? undefined;
const headScript = process.env.NEXT_PUBLIC_HEAD_SCRIPTS;
const bodyScript = process.env.NEXT_PUBLIC_BODY_SCRIPTS;
const scripts = [
{
id: "injected-head-script",
script: headScript ?? "",
},
{
id: "injected-body-script",
script: bodyScript ?? "",
},
].filter((script): script is { id: string; script: string } => !!script.script);
return (
<>
<PageWrapper requiresLicense={false} nonce={nonce}>
{children}
{scripts.map((script) => (
<Script
key={script.id}
nonce={nonce}
id={script.id}
dangerouslySetInnerHTML={{
__html: script.script,
}}
/>
))}
</PageWrapper>
</>
);
}