"use client"
/**
* Email header and footer — the brand blocks above and below the message.
*
* `EmailHeaderFooterPicker` sits inside the message area: empty, it is a quiet "Add header"
* row; once chosen it is the block with a separator, plus Change and Remove. The same blocks
* render in the preview, so what the sender picks is what recipients see.
*/
import * as React from "react"
import { cn } from "../../lib/utils"
import { Button } from "../ui/button"
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "../ui/dropdown-menu"
import { Tip } from "../ui/tip"
import type { EmailBrand } from "./email-composer-types"
export type EmailHeaderKind = "none" | "logo" | "logo-name"
export type EmailFooterKind = "none" | "logo" | "product" | "contact"
export const EMAIL_HEADER_OPTIONS: { value: EmailHeaderKind; label: string }[] = [
{ value: "none", label: "No header" },
{ value: "logo", label: "School or site logo" },
{ value: "logo-name", label: "Logo with name and office" },
]
export const EMAIL_FOOTER_OPTIONS: { value: EmailFooterKind; label: string }[] = [
{ value: "none", label: "No footer" },
{ value: "logo", label: "School or site logo" },
{ value: "product", label: "Product logo" },
{ value: "contact", label: "Address and contact" },
]
/**
* Single-choice menu row that marks the current choice with a check on the right, the way a
* Select does, instead of a radio dot.
*/
export function CheckMenuItem({
selected,
onSelect,
className,
children,
}: {
selected: boolean
onSelect: () => void
className?: string
children: React.ReactNode
}) {
return (
) : (
{brand.name.trim()[0]?.toUpperCase()}
)
}
export function EmailHeaderBlock({ kind, brand }: { kind: EmailHeaderKind; brand: EmailBrand }) {
if (kind === "none") return null
return (