import { ShellPage } from "@/components/page-templates"; import { SectionCard } from "@/components/ui"; import { getSession } from "@/lib/auth"; import { prisma } from "@/lib/prisma"; import { redirect } from "next/navigation"; export default async function TemplateDetailPage({ params }: { params: Promise<{ templateId: string }> }) { const { templateId } = await params; const session = await getSession(); if (!session) { redirect("/login"); } const template = await prisma.messageTemplate.findFirst({ where: { id: templateId, tenantId: session.tenantId }, include: { channel: true } }); if (!template) { redirect("/templates?error=template_not_found"); } return (

Name: {template.name}

Category: {template.category}

Language: {template.languageCode}

{template.bodyText}

Approval: {template.approvalStatus}

Channel: {template.channel.channelName}

Provider id: {template.providerTemplateId || "-"}

Rejected reason: {template.rejectedReason || "-"}

); }