From f61bf0070263ce80a25bd049a1f1990b663717f4 Mon Sep 17 00:00:00 2001 From: Ephraim Atta-Duncan Date: Tue, 4 Jul 2023 00:59:25 +0000 Subject: [PATCH] feat: pass document id as prop to the actions component --- apps/web/src/app/(dashboard)/dashboard/page.tsx | 4 ++-- apps/web/src/app/(dashboard)/documents/data-table.tsx | 2 +- .../components/(dashboard)/table/actions-component.tsx | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/web/src/app/(dashboard)/dashboard/page.tsx b/apps/web/src/app/(dashboard)/dashboard/page.tsx index 96a2f5a92..487c59bbb 100644 --- a/apps/web/src/app/(dashboard)/dashboard/page.tsx +++ b/apps/web/src/app/(dashboard)/dashboard/page.tsx @@ -84,8 +84,8 @@ export default async function DashboardPage() { - - + + ))} diff --git a/apps/web/src/app/(dashboard)/documents/data-table.tsx b/apps/web/src/app/(dashboard)/documents/data-table.tsx index 1019dd0cb..efcf93794 100644 --- a/apps/web/src/app/(dashboard)/documents/data-table.tsx +++ b/apps/web/src/app/(dashboard)/documents/data-table.tsx @@ -63,7 +63,7 @@ export const DocumentsDataTable = ({ results }: DocumentsDataTableProps) => { { header: 'Actions', accessorKey: 'actions', - cell: () => , + cell: ({ row }) => , }, ]} data={results.data} diff --git a/apps/web/src/components/(dashboard)/table/actions-component.tsx b/apps/web/src/components/(dashboard)/table/actions-component.tsx index 299a37fda..47fc89f2e 100644 --- a/apps/web/src/components/(dashboard)/table/actions-component.tsx +++ b/apps/web/src/components/(dashboard)/table/actions-component.tsx @@ -4,28 +4,28 @@ import React from 'react'; import { Download, Edit, Trash } from 'lucide-react'; -export function ActionButtons() { +export function ActionButtons({ documentId }: { documentId: number }) { return (
{ - console.log('Edit Button'); + console.log('Edit Document with id: ', documentId); }} /> { - console.log('Download Button'); + console.log('Download Document with id: ', documentId); }} /> { - console.log('Delete Button'); + console.log('Delete Document with id: ', documentId); }} />