import { Suspense } from 'react'; import { Button } from '@/components/ui/button'; import Link from 'next/link'; import { Plus, Loader2 } from 'lucide-react'; import { CorrespondencesContent } from '@/components/correspondences/correspondences-content'; import { Can } from '@/components/common/can'; export const dynamic = 'force-dynamic'; interface CorrespondencesPageProps { searchParams: Promise<{ type?: string; }>; } export default async function CorrespondencesPage({ searchParams, }: CorrespondencesPageProps) { const params = await searchParams; const isRfaView = params?.type?.toUpperCase() === 'RFA'; const heading = isRfaView ? 'RFAs (Request for Approval)' : 'Correspondences'; const description = isRfaView ? 'Unified list view for RFA documents' : 'Manage official letters and communications'; const createHref = isRfaView ? '/rfas/new' : '/correspondences/new'; const createLabel = isRfaView ? 'New RFA' : 'New Correspondence'; return (
{description}