Skip to content

Commit 5b6d0ae

Browse files
committed
fix: update item description handling in DashboardPage component
- Made the item description optional in the Item interface to accommodate cases where it may not be provided. - Updated the rendering of item descriptions in the DashboardPage to display an empty string when the description is null or undefined, improving UI consistency.
1 parent db7a5f4 commit 5b6d0ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

frontend/app/dashboard/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import Link from "next/link";
2121
interface Item {
2222
id: string;
2323
title: string;
24-
description: string;
24+
description?: string | null;
2525
quantity?: number;
2626
owner_id?: string;
2727
}
@@ -108,7 +108,7 @@ export default async function DashboardPage() {
108108
itemsList.map((item, index) => (
109109
<TableRow key={index}>
110110
<TableCell>{item.title}</TableCell>
111-
<TableCell>{item.description}</TableCell>
111+
<TableCell>{item.description ?? ""}</TableCell>
112112
<TableCell className="text-center">
113113
<DropdownMenu>
114114
<DropdownMenuTrigger className="cursor-pointer p-1 text-gray-600 hover:text-gray-800">

0 commit comments

Comments
 (0)