feat: Implement task notes functionality with CRUD operations and integrate into project tasks section

This commit is contained in:
Chop
2025-06-03 20:46:37 +02:00
parent a9afebdda5
commit 330744daf9
9 changed files with 309 additions and 20 deletions

View File

@@ -13,8 +13,9 @@ import PageContainer from "@/components/ui/PageContainer";
import PageHeader from "@/components/ui/PageHeader";
export default async function ProjectViewPage({ params }) {
const project = getProjectWithContract(params.id);
const notes = getNotesForProject(params.id);
const { id } = await params;
const project = getProjectWithContract(id);
const notes = getNotesForProject(id);
const daysRemaining = differenceInCalendarDays(
parseISO(project.finish_date),
new Date()
@@ -70,8 +71,8 @@ export default async function ProjectViewPage({ params }) {
</svg>
Back to Projects
</Button>
</Link>
<Link href={`/projects/${params.id}/edit`}>
</Link>{" "}
<Link href={`/projects/${id}/edit`}>
<Button variant="secondary">Edit Project</Button>
</Link>
</div>
@@ -142,7 +143,6 @@ export default async function ProjectViewPage({ params }) {
)}
</CardContent>
</Card>
<Card>
<CardHeader>
<h2 className="text-xl font-semibold text-gray-900">
@@ -175,10 +175,10 @@ export default async function ProjectViewPage({ params }) {
<p className="text-gray-900">{project.investor}</p>
</div>
</CardContent>
</Card>
</Card>{" "}
</div>
<ProjectTasksSection projectId={params.id} />
<ProjectTasksSection projectId={id} />
<Card>
<CardHeader>
@@ -186,7 +186,7 @@ export default async function ProjectViewPage({ params }) {
</CardHeader>
<CardContent>
<div className="mb-6">
<NoteForm projectId={params.id} />
<NoteForm projectId={id} />
</div>
{notes.length === 0 ? (
<div className="text-center py-8">