Some checks are pending
E2E / Playwright e2e (push) Waiting to run
- Refactored metadata for contacts, administration, and Ulticards pages to utilize dynamic app names and descriptions. - Introduced new product pages for Ultiai, Ultical, Ulticards, Ultidrive, Ultimail, and Ultimeet with appropriate metadata. - Enhanced layout components to ensure consistent styling and functionality across new product sections. - Updated various components to replace hardcoded labels with dynamic references to improve maintainability and consistency.
43 lines
1.5 KiB
TypeScript
43 lines
1.5 KiB
TypeScript
"use client"
|
|
|
|
import { useLayoutEffect, type ReactNode } from "react"
|
|
import { DEMO_USER } from "@/components/demo/demo-mail-data"
|
|
import { DEMO_MAIL_ACCOUNT_ID } from "@/lib/demo/demo-mail-api-data"
|
|
import { DemoMailProvider } from "@/lib/demo/demo-mail-context"
|
|
import { ComposeProvider } from "@/lib/compose-context"
|
|
import { ScheduledMailProvider } from "@/lib/scheduled-mail-context"
|
|
import { useAccountStore } from "@/lib/stores/account-store"
|
|
import { useComposeIdentitiesStore } from "@/lib/stores/compose-identities-store"
|
|
|
|
function ProductMailDemoBootstrap() {
|
|
useLayoutEffect(() => {
|
|
useAccountStore.getState().setActiveAccountId(DEMO_MAIL_ACCOUNT_ID)
|
|
useComposeIdentitiesStore.getState().hydrateFromApi([
|
|
{
|
|
id: "product-demo-compose-identity",
|
|
accountId: DEMO_MAIL_ACCOUNT_ID,
|
|
name: DEMO_USER.name,
|
|
email: DEMO_USER.email,
|
|
defaultSignatureId: null,
|
|
signatureHtml: null,
|
|
isDefault: true,
|
|
},
|
|
])
|
|
}, [])
|
|
return null
|
|
}
|
|
|
|
/** Providers minimaux pour embarquer le compositeur mail en démo produit. */
|
|
export function ProductMailDemoShell({ children }: { children: ReactNode }) {
|
|
return (
|
|
<DemoMailProvider onReset={() => {}}>
|
|
<ProductMailDemoBootstrap />
|
|
<ComposeProvider>
|
|
<ScheduledMailProvider>
|
|
<div className="h-full w-full bg-transparent text-foreground">{children}</div>
|
|
</ScheduledMailProvider>
|
|
</ComposeProvider>
|
|
</DemoMailProvider>
|
|
)
|
|
}
|