diff --git a/compass/components/Table/ResourceTable.tsx b/compass/components/Table/ResourceTable.tsx index 2eedc65..b2b89d9 100644 --- a/compass/components/Table/ResourceTable.tsx +++ b/compass/components/Table/ResourceTable.tsx @@ -18,8 +18,8 @@ export function ResourceTable({ resources }: { resources: Resource[] }) { "volunteer", "employee", ]) - - const handleRowUpdate = (updatedRow: Resource) => { + + const handleRowUpdate = (updatedRow: DataPoint) => { const dataIndex = data.findIndex((row) => row.id === updatedRow.id); if (dataIndex !== -1) { const updatedData = [...data]; diff --git a/compass/components/Table/RowOpenAction.tsx b/compass/components/Table/RowOpenAction.tsx index 2310046..970a8b8 100644 --- a/compass/components/Table/RowOpenAction.tsx +++ b/compass/components/Table/RowOpenAction.tsx @@ -1,10 +1,17 @@ import Drawer from "@/components/Drawer/Drawer"; -import { ChangeEvent, useState } from "react"; +import { useState } from "react"; +import { DataPoint } from "@/components/Table/Table"; -export const RowOpenAction = ({ title, rowData, onRowUpdate }) => { +type RowOpenActionProps = { + title: string, + rowData: DataPoint, + onRowUpdate: (updatedRow: DataPoint) => void; +} + +export const RowOpenAction = ({ title, rowData, onRowUpdate }: RowOpenActionProps) => { const [pageContent, setPageContent] = useState(""); - const handleDrawerContentChange = (newContent) => { + const handleDrawerContentChange = (newContent: string) => { setPageContent(newContent); };