Remove unused redirects from the Next.js configuration and update package dependencies to include new Tiptap extensions for enhanced text editing capabilities. Clean up the database seeding script by removing commented-out code and ensuring proper deletion of obsolete entries. Update various pages to handle not found scenarios gracefully, improving user experience across the application.
This commit is contained in:
1 parent
4b84409ed7
commit
2858b9c746
106 files changed
+2516
-1004
No files matched your search
@@ -1,93 +1,5 @@
|
||||
import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Heading } from "@/components/atoms/Heading";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { BadgeLabel } from "@/components/atoms/BadgeLabel";
|
||||
import { DetailList } from "@/components/molecules/DetailList";
|
||||
import { PageHero } from "@/components/molecules/PageHero";
|
||||
import { SectionHeader } from "@/components/molecules/SectionHeader";
|
||||
import { SurfaceCard } from "@/components/molecules/SurfaceCard";
|
||||
import { buttonVariants } from "@/components/ui/button";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { getPrograms } from "@/lib/data/programs";
|
||||
import { pageMetadata } from "@/lib/seo/metadata";
|
||||
import { notFound } from "next/navigation";
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const t = await getTranslations("pages");
|
||||
return pageMetadata({
|
||||
title: t("programsTitle"),
|
||||
description: t("programsIntro"),
|
||||
path: "/programs",
|
||||
});
|
||||
}
|
||||
|
||||
export default async function ProgramsPage() {
|
||||
const t = await getTranslations("pages");
|
||||
const programs = await getPrograms();
|
||||
const standard = programs.filter((p) => p.group === "standard");
|
||||
const executive = programs.filter((p) => p.group === "executive");
|
||||
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero
|
||||
title={t("programsTitle")}
|
||||
intro={t("programsIntro")}
|
||||
imageUrl="/brand/neural-tree-knowledge.webp"
|
||||
/>
|
||||
<Section tone="subtle">
|
||||
<Container className="space-y-16">
|
||||
<ProgramGroup title={t("standardGroup")} items={standard} />
|
||||
<ProgramGroup title={t("executiveGroup")} items={executive} />
|
||||
</Container>
|
||||
</Section>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
function ProgramGroup({
|
||||
title,
|
||||
items,
|
||||
}: {
|
||||
title: string;
|
||||
items: Awaited<ReturnType<typeof getPrograms>>;
|
||||
}) {
|
||||
if (items.length === 0) return null;
|
||||
return (
|
||||
<div>
|
||||
<SectionHeader title={title} className="mb-6 sm:mb-8" />
|
||||
<div className="grid gap-5 md:grid-cols-2">
|
||||
{items.map((program) => (
|
||||
<SurfaceCard key={program.id} padded className="flex flex-col">
|
||||
{program.tagline ? (
|
||||
<BadgeLabel className="w-fit">{program.tagline}</BadgeLabel>
|
||||
) : null}
|
||||
<Heading as="h3" level={3} className="mt-3">
|
||||
<Link href={program.href} className="transition-colors hover:text-accent">
|
||||
{program.title}
|
||||
</Link>
|
||||
</Heading>
|
||||
<p className="mt-2 flex-1 text-sm leading-7 text-muted-foreground">
|
||||
{program.blurb}
|
||||
</p>
|
||||
<DetailList
|
||||
className="mt-5 border-t border-border pt-4"
|
||||
items={[
|
||||
{ label: "مخاطب", value: program.audience },
|
||||
{ label: "مدت", value: program.durationLabel },
|
||||
{ label: "فرمت", value: program.formatLabel },
|
||||
]}
|
||||
/>
|
||||
<Link
|
||||
href={program.href}
|
||||
className={cn(buttonVariants({ variant: "outline" }), "mt-6 w-fit")}
|
||||
>
|
||||
جزئیات برنامه
|
||||
</Link>
|
||||
</SurfaceCard>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
export default function ProgramsPage() {
|
||||
notFound();
|
||||
}
|
||||
Reference in new issue
Block a user