251208:0010 Backend & Frontend Debug
Some checks failed
Spec Validation / validate-markdown (push) Has been cancelled
Spec Validation / validate-diagrams (push) Has been cancelled
Spec Validation / check-todos (push) Has been cancelled

This commit is contained in:
2025-12-08 00:10:37 +07:00
parent 32d820ea6b
commit dcd126d704
99 changed files with 2775 additions and 1480 deletions

View File

@@ -1,21 +1,32 @@
import { rfaApi } from "@/lib/api/rfas";
import { RFADetail } from "@/components/rfas/detail";
import { notFound } from "next/navigation";
"use client";
export default async function RFADetailPage({
params,
}: {
params: { id: string };
}) {
const id = parseInt(params.id);
if (isNaN(id)) {
notFound();
import { RFADetail } from "@/components/rfas/detail";
import { notFound, useParams } from "next/navigation";
import { useRFA } from "@/hooks/use-rfa";
import { Loader2 } from "lucide-react";
export default function RFADetailPage() {
const { id } = useParams();
if (!id) notFound();
const { data: rfa, isLoading, isError } = useRFA(String(id));
if (isLoading) {
return (
<div className="flex justify-center items-center py-20">
<Loader2 className="h-8 w-8 animate-spin" />
</div>
);
}
const rfa = await rfaApi.getById(id);
if (!rfa) {
notFound();
if (isError || !rfa) {
// Check if error is 404
return (
<div className="text-center py-20 text-red-500">
RFA not found or failed to load.
</div>
);
}
return <RFADetail data={rfa} />;