compass/compass/components/Table/RowOpenAction.tsx
Prajwal Moharana 469236cb04
Delete Button and Update QoL changes (#60)
* Edit visibility for options depending on administrator status

* Connect delete frontend route to delete backend

* small readme.md changes

* Fix table lines and update bug

* Add clicking outside of drawer to close
2025-04-25 12:10:36 -04:00

45 lines
1.1 KiB
TypeScript

import Drawer, { Details } from "@/components/Drawer/Drawer";
import DataPoint from "@/utils/models/DataPoint";
import {
EnvelopeIcon,
ListBulletIcon,
UserIcon,
} from "@heroicons/react/24/solid";
import { Dispatch, SetStateAction, useState } from "react";
type RowOpenActionProps<T extends DataPoint> = {
title: string;
titleKey: string;
rowData: T;
setData: Dispatch<SetStateAction<T[]>>;
details: Details[];
isAdmin?: boolean;
updateRoute: string;
};
export function RowOpenAction<T extends DataPoint>({
title,
titleKey,
rowData,
setData,
details,
isAdmin,
updateRoute,
}: RowOpenActionProps<T>) {
return (
<div className="font-semibold group flex flex-row items-center justify-between px-2">
{title}
<span>
<Drawer
titleKey={titleKey}
rowContent={rowData}
details={details}
setRowContent={setData}
isAdmin={isAdmin}
updateRoute={updateRoute}
/>
</span>
</div>
);
}