Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvuGvHpbAQ4syfuLuRvutL
86 lines
3.3 KiB
TypeScript
86 lines
3.3 KiB
TypeScript
import Link from "next/link";
|
|
import { db } from "@/lib/db";
|
|
import { getSettings } from "@/lib/settings";
|
|
import { NewsletterForm } from "./NewsletterForm";
|
|
|
|
export async function Footer() {
|
|
const [settings, categories, pages, payments] = await Promise.all([
|
|
getSettings(),
|
|
db.category.findMany({ where: { active: true, parentId: null }, orderBy: { sort: "asc" }, take: 5 }),
|
|
db.page.findMany({ where: { published: true, NOT: { showInFooter: "" } }, orderBy: { sort: "asc" } }),
|
|
db.paymentMethod.findMany({ where: { enabled: true }, orderBy: { sort: "asc" } }),
|
|
]);
|
|
const s = settings.general;
|
|
const a = settings.appearance;
|
|
const service = pages.filter((p) => p.showInFooter === "service");
|
|
const company = pages.filter((p) => p.showInFooter === "company");
|
|
const legal = pages.filter((p) => p.showInFooter === "legal");
|
|
return (
|
|
<footer className="sm-footer" data-theme="dark">
|
|
<div className="sm-container">
|
|
<div className="sm-footer__grid">
|
|
<div className="sm-footer__brand">
|
|
<Link className="sm-footer__logo" href="/">
|
|
{/* eslint-disable-next-line @next/next/no-img-element */}
|
|
<img src="/brand/logo-gold.png" alt={`${s.shopName} Pilates`} width={962} height={783} />
|
|
</Link>
|
|
<p className="sm-footer__claim">{a.footerClaim}</p>
|
|
{a.showNewsletter && (
|
|
<>
|
|
<p className="sm-footer__title" style={{ marginTop: "var(--space-5)" }}>
|
|
Newsletter
|
|
</p>
|
|
<NewsletterForm />
|
|
</>
|
|
)}
|
|
</div>
|
|
<div>
|
|
<p className="sm-footer__title">Shop</p>
|
|
<ul className="sm-footer__links">
|
|
<li><Link href="/shop">Alle Produkte</Link></li>
|
|
{categories.map((c) => (
|
|
<li key={c.id}><Link href={`/kategorie/${c.slug}`}>{c.name}</Link></li>
|
|
))}
|
|
</ul>
|
|
</div>
|
|
<div>
|
|
<p className="sm-footer__title">Service</p>
|
|
<ul className="sm-footer__links">
|
|
{service.map((p) => (
|
|
<li key={p.id}><Link href={`/seite/${p.slug}`}>{p.title}</Link></li>
|
|
))}
|
|
<li><Link href="/konto">Mein Konto</Link></li>
|
|
</ul>
|
|
</div>
|
|
<div>
|
|
<p className="sm-footer__title">{s.shopName}</p>
|
|
<ul className="sm-footer__links">
|
|
{company.map((p) => (
|
|
<li key={p.id}><Link href={`/seite/${p.slug}`}>{p.title}</Link></li>
|
|
))}
|
|
{s.email && <li><a href={`mailto:${s.email}`}>{s.email}</a></li>}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div className="sm-footer__bottom">
|
|
<div>
|
|
© {new Date().getFullYear()} {s.shopName}
|
|
{legal.map((p) => (
|
|
<span key={p.id}>
|
|
{" · "}
|
|
<Link href={`/seite/${p.slug}`} style={{ color: "inherit" }}>{p.title}</Link>
|
|
</span>
|
|
))}
|
|
</div>
|
|
{payments.length > 0 && (
|
|
<div className="sm-footer__pay" aria-label="Zahlungsarten">
|
|
{payments.map((p) => (
|
|
<span key={p.id}>{p.name.split(",")[0]}</span>
|
|
))}
|
|
</div>
|
|
)}
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
);
|
|
}
|