import type { MemorialData } from "@/types";

export function formatDates(born: string | null, passed: string | null): string {
  if (born && passed) return `${born} \u2014 ${passed}`;
  if (passed) return passed;
  if (born) return born;
  return "";
}

export function MemorialFooter({ name }: { name: string | null }) {
  return (
    <footer className="border-t border-stone-200 py-10 text-center">
      <div className="mx-auto mb-3 flex h-8 w-8 items-center justify-center rounded-full bg-amber-100">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" className="h-5 w-5 text-amber-600">
          <path d="M12 3C7 8 4 11 4 14.5C4 18 7 21 12 21C17 21 20 18 20 14.5C20 11 17 8 12 3Z" strokeLinecap="round" strokeLinejoin="round" />
        </svg>
      </div>
      <p className="text-sm italic text-stone-400">Во спомен на</p>
      {name && <p className="mt-1 text-xs text-stone-400">{name}</p>}
    </footer>
  );
}
