mirror of
https://github.com/cssgunc/compass.git
synced 2025-04-28 05:49:49 -04:00
* 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
45 lines
1.1 KiB
TypeScript
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>
|
|
);
|
|
}
|