diff --git a/frontend/src/components/DetailsDialog.tsx b/frontend/src/components/DetailsDialog.tsx
index 709da46..2436f79 100644
--- a/frontend/src/components/DetailsDialog.tsx
+++ b/frontend/src/components/DetailsDialog.tsx
@@ -1,108 +1,117 @@
import { useMemo, useState } from "react";
import {
- Dialog,
- DialogContent,
- DialogHeader,
- DialogTitle,
- DialogFooter,
- DialogClose,
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ DialogFooter,
+ DialogClose,
} from "@/components/ui/dialog";
import { Button } from "@/components/ui/button";
import { MoreHorizontal } from "lucide-react";
type DetailsCellProps = {
- text?: string | null;
- limit?: number;
- title?: string;
- triggerVariant?: "text" | "icon";
- justify?: "between" | "start" | "center"
+ text?: string | null;
+ limit?: number;
+ title?: string;
+ triggerVariant?: "text" | "icon";
+ justify?: "between" | "start" | "center";
};
export function DetailsDialog({
- text,
- limit = 25,
- title = "Details",
- triggerVariant = "text",
- justify = "between"
+ text,
+ limit = 25,
+ title = "Details",
+ triggerVariant = "text",
+ justify = "between",
}: DetailsCellProps) {
- const [open, setOpen] = useState(false);
- const value = text ?? "";
-
- const isTruncated = value.length > limit;
- const wrapperJustifyClass = justify === "start" ? "justify-start" : justify === "center" ? "justify-center" : "justify-between"
-
- const display = useMemo(() => {
- if (!value) return "";
-
- if (!isTruncated) return value;
-
- if (triggerVariant === "text") {
- return value.slice(0, limit) + "...";
- }
-
- return value.slice(0, limit);
- }, [value, limit, isTruncated, triggerVariant]);
-
- const handleOpen = () => setOpen(true);
-
- return (
- <>
-
-
- {display}
-
-
-
- {isTruncated && (
- <>
- {triggerVariant === "text" && (
-
- )}
-
- {triggerVariant === "icon" && (
-