251205:0000 Just start debug backend/frontend
This commit is contained in:
22
frontend/app/(dashboard)/rfas/[id]/page.tsx
Normal file
22
frontend/app/(dashboard)/rfas/[id]/page.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { rfaApi } from "@/lib/api/rfas";
|
||||
import { RFADetail } from "@/components/rfas/detail";
|
||||
import { notFound } from "next/navigation";
|
||||
|
||||
export default async function RFADetailPage({
|
||||
params,
|
||||
}: {
|
||||
params: { id: string };
|
||||
}) {
|
||||
const id = parseInt(params.id);
|
||||
if (isNaN(id)) {
|
||||
notFound();
|
||||
}
|
||||
|
||||
const rfa = await rfaApi.getById(id);
|
||||
|
||||
if (!rfa) {
|
||||
notFound();
|
||||
}
|
||||
|
||||
return <RFADetail data={rfa} />;
|
||||
}
|
||||
16
frontend/app/(dashboard)/rfas/new/page.tsx
Normal file
16
frontend/app/(dashboard)/rfas/new/page.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import { RFAForm } from "@/components/rfas/form";
|
||||
|
||||
export default function NewRFAPage() {
|
||||
return (
|
||||
<div className="max-w-4xl mx-auto py-6">
|
||||
<div className="mb-8">
|
||||
<h1 className="text-3xl font-bold">New RFA</h1>
|
||||
<p className="text-muted-foreground mt-1">
|
||||
Create a new Request for Approval.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<RFAForm />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
48
frontend/app/(dashboard)/rfas/page.tsx
Normal file
48
frontend/app/(dashboard)/rfas/page.tsx
Normal file
@@ -0,0 +1,48 @@
|
||||
import { RFAList } from "@/components/rfas/list";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import Link from "next/link";
|
||||
import { Plus } from "lucide-react";
|
||||
import { rfaApi } from "@/lib/api/rfas";
|
||||
import { Pagination } from "@/components/common/pagination";
|
||||
|
||||
export default async function RFAsPage({
|
||||
searchParams,
|
||||
}: {
|
||||
searchParams: { page?: string; status?: string; search?: string };
|
||||
}) {
|
||||
const page = parseInt(searchParams.page || "1");
|
||||
const data = await rfaApi.getAll({
|
||||
page,
|
||||
status: searchParams.status,
|
||||
search: searchParams.search,
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<div className="flex justify-between items-center">
|
||||
<div>
|
||||
<h1 className="text-3xl font-bold">RFAs (Request for Approval)</h1>
|
||||
<p className="text-muted-foreground mt-1">
|
||||
Manage approval requests and submissions
|
||||
</p>
|
||||
</div>
|
||||
<Link href="/rfas/new">
|
||||
<Button>
|
||||
<Plus className="mr-2 h-4 w-4" />
|
||||
New RFA
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<RFAList data={data} />
|
||||
|
||||
<div className="mt-4">
|
||||
<Pagination
|
||||
currentPage={data.page}
|
||||
totalPages={data.totalPages}
|
||||
total={data.total}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user