import { Skeleton } from "@/components/ui/skeleton";

/**
 * Loading shape shown while a page's link-dependent content loads (the <Suspense> fallback on the details, job and
 * apply pages; no Figma design). Faint blocks in the layout those pages share: a badge, a two-line headline,
 * a few text lines and a button on one side, a card on the other (under the text on smaller screens).
 * At least a screen tall, so the footer doesn't jump. Links to those pages prefetch them, so it is rarely seen.
 * `label` is read by screen readers ("Loading…"); without it the shape is hidden from them.
 */
export function PageContentPlaceholder({ label }: { label?: string }) {
  return (
    <div role={label ? "status" : undefined} aria-hidden={label ? undefined : true} className="min-h-svh pt-[100px]">
      {label && <span className="sr-only">{label}</span>}
      <div className="container-site flex flex-col gap-10 py-12 lg:flex-row lg:items-center lg:justify-between lg:py-32">
        <div className="flex w-full max-w-2xl flex-col gap-5">
          <Skeleton className="h-7 w-32 rounded-full" />
          <Skeleton className="h-10 w-4/5 lg:h-16" />
          <Skeleton className="h-10 w-3/5 lg:h-16" />
          <div className="flex flex-col gap-3 pt-2">
            <Skeleton className="h-4 w-full" />
            <Skeleton className="h-4 w-11/12" />
            <Skeleton className="h-4 w-2/3" />
          </div>
          <Skeleton className="mt-3 h-12 w-40 rounded-full" />
        </div>
        <Skeleton className="aspect-[320/384] w-full max-w-80 shrink-0 rounded-3xl lg:w-80" />
      </div>
    </div>
  );
}
