Files
Calbook/components/layout/public-footer.tsx

59 lines
1.9 KiB
TypeScript

import Link from "next/link";
import { cn } from "@/lib/utils";
type PublicFooterProps = {
companyName?: string;
privacyLabel?: string;
privacyHref?: string;
imprintLabel?: string;
imprintHref?: string;
copyrightTemplate?: string;
className?: string;
};
export function PublicFooter({
companyName = "CalBook",
privacyLabel = "Datenschutz",
privacyHref = "/datenschutz",
imprintLabel = "Impressum",
imprintHref = "/impressum",
copyrightTemplate = "© {{year}} {{companyName}}",
className
}: PublicFooterProps) {
const year = String(new Date().getFullYear());
const copyrightText = (copyrightTemplate || "© {{year}} {{companyName}}")
.replace(/\{\{\s*year\s*\}\}/gi, year)
.replace(/\{\{\s*companyName\s*\}\}/gi, companyName)
.trim();
return (
<footer className={cn("w-full border-t border-slate-200 bg-slate-50", className)}>
<div className="w-full px-4 py-4 lg:px-8">
<div className="flex items-center justify-between gap-4">
<nav className="flex h-5 items-center gap-4 text-xs leading-none text-slate-500">
{privacyLabel && privacyHref ? (
<Link
href={privacyHref}
className="inline-flex h-5 items-center whitespace-nowrap transition-colors hover:text-slate-700"
>
{privacyLabel}
</Link>
) : null}
{imprintLabel && imprintHref ? (
<Link
href={imprintHref}
className="inline-flex h-5 items-center whitespace-nowrap transition-colors hover:text-slate-700"
>
{imprintLabel}
</Link>
) : null}
</nav>
<p className="flex h-5 items-center whitespace-nowrap text-right text-xs leading-none text-slate-400">
{copyrightText || `© ${year} ${companyName}`}
</p>
</div>
</div>
</footer>
);
}