diff options
Diffstat (limited to 'lib/owner-companies/owner-company-list.tsx')
| -rw-r--r-- | lib/owner-companies/owner-company-list.tsx | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/lib/owner-companies/owner-company-list.tsx b/lib/owner-companies/owner-company-list.tsx new file mode 100644 index 00000000..b78b193b --- /dev/null +++ b/lib/owner-companies/owner-company-list.tsx @@ -0,0 +1,85 @@ +// app/(admin)/owner-companies/_components/owner-company-list.tsx +"use client"; + +import { Button } from "@/components/ui/button"; +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from "@/components/ui/table"; +import Link from "next/link"; +import { Building2, Users } from "lucide-react"; + +interface OwnerCompany { + id: number; + name: string; + createdAt: Date; +} + +interface OwnerCompanyListProps { + companies: OwnerCompany[]; +} + +export function OwnerCompanyList({ companies }: OwnerCompanyListProps) { + if (companies.length === 0) { + return ( + <div className="text-center py-12"> + <Building2 className="mx-auto h-12 w-12 text-muted-foreground" /> + <h3 className="mt-4 text-lg font-semibold">등록된 회사가 없습니다</h3> + <p className="mt-2 text-sm text-muted-foreground"> + 첫 번째 발주처 회사를 등록해보세요. + </p> + <Button asChild className="mt-4"> + <Link href="/evcp/data-room/owner-companies/new">회사 등록</Link> + </Button> + </div> + ); + } + + return ( + <Table> + <TableHeader> + <TableRow> + <TableHead>회사명</TableHead> + <TableHead>등록일</TableHead> + <TableHead className="text-right">작업</TableHead> + </TableRow> + </TableHeader> + <TableBody> + {companies.map((company) => ( + <TableRow key={company.id}> + <TableCell className="font-medium"> + <div className="flex items-center gap-2"> + <Building2 className="h-4 w-4 text-muted-foreground" /> + {company.name} + </div> + </TableCell> + <TableCell> + {new Date(company.createdAt).toLocaleDateString("ko-KR", { + year: "numeric", + month: "long", + day: "numeric", + })} + </TableCell> + <TableCell className="text-right"> + <div className="flex gap-2 justify-end"> + <Button variant="outline" size="sm" asChild> + <Link href={`/owner-companies/${company.id}`}>수정</Link> + </Button> + <Button variant="outline" size="sm" asChild> + <Link href={`/evcp/data-room/owner-companies/${company.id}/users`}> + <Users className="h-4 w-4 mr-1" /> + 사용자 관리 + </Link> + </Button> + </div> + </TableCell> + </TableRow> + ))} + </TableBody> + </Table> + ); +}
\ No newline at end of file |
