import type { AssembledProposal } from "@/lib/proposal/assemble";

type Props = { header: AssembledProposal["header"] };

export function CoverSection({ header }: Props) {
  return (
    <div className="h-full flex flex-col justify-between px-16 py-24">
      <p className="text-xs font-mono tracking-widest text-muted-foreground uppercase">
        Documento di Soluzione
      </p>

      <div className="space-y-6">
        <h1 className="text-6xl font-light leading-tight tracking-tight text-foreground">
          {header.offerTitle.split(" ").map((word, i, arr) => {
            const isLast = i === arr.length - 1;
            return (
              <span key={i}>
                {isLast ? <span className="text-primary font-normal">{word}</span> : `${word} `}
              </span>
            );
          })}
        </h1>
        {header.offerDescription && (
          <p className="text-lg text-muted-foreground max-w-2xl">{header.offerDescription}</p>
        )}
        <p className="text-base text-foreground">
          {header.clientName} × {header.consultantName}
        </p>
        <div className="flex items-center gap-6 text-xs font-mono text-muted-foreground">
          <span>Data: {header.date}</span>
          <span>·</span>
          <span>Validità {header.validityDays} giorni</span>
        </div>
      </div>

      <div />
    </div>
  );
}
