feat: Implement TaskStatusDropdown and integrate it across project and task components

This commit is contained in:
Chop
2025-06-19 22:59:48 +02:00
parent 2f5194bb4e
commit 1dc3fd88f9
7 changed files with 388 additions and 177 deletions

View File

@@ -50,6 +50,7 @@ export default async function ProjectViewPage({ params }) {
description={`${project.city}${project.address}`}
action={
<div className="flex items-center gap-3">
<ProjectStatusDropdown project={project} size="sm" />
{daysRemaining !== null && (
<Badge variant={getDeadlineVariant(daysRemaining)} size="md">
{daysRemaining === 0
@@ -103,6 +104,7 @@ export default async function ProjectViewPage({ params }) {
<div className="lg:col-span-2 space-y-6">
<Card>
<CardHeader>
{" "}
<div className="flex items-center justify-between">
<h2 className="text-xl font-semibold text-gray-900">
Project Information
@@ -283,37 +285,13 @@ export default async function ProjectViewPage({ params }) {
</h2>
</CardHeader>
<CardContent className="space-y-4">
{" "}
<div>
<span className="text-sm font-medium text-gray-500 block mb-2">
Current Status
</span>
<div className="flex items-center gap-2">
<Badge
variant={
project.project_status === "fulfilled"
? "success"
: project.project_status === "registered"
? "secondary"
: "primary"
}
size="md"
>
{project.project_status === "registered"
? "Registered"
: project.project_status === "in_progress_design"
? "In Progress (Design)"
: project.project_status === "in_progress_construction"
? "In Progress (Construction)"
: project.project_status === "fulfilled"
? "Completed"
: "Unknown"}
</Badge>
</div>
<div className="mt-3">
<ProjectStatusDropdown project={project} />
</div>
<ProjectStatusDropdown project={project} size="md" />
</div>
{daysRemaining !== null && (
<div className="border-t pt-4">
<span className="text-sm font-medium text-gray-500 block mb-2">