Files
deer-flow/frontend/src/components/workspace/artifacts/artifact-file-detail.tsx

29 lines
783 B
TypeScript
Raw Normal View History

2026-01-17 00:05:19 +08:00
import { FileIcon, XIcon } from "lucide-react";
import { useCallback } from "react";
import { Button } from "@/components/ui/button";
import { useArtifacts } from "./context";
2026-01-17 00:02:03 +08:00
export function ArtifactFileDetail({ filepath }: { filepath: string }) {
2026-01-17 00:05:19 +08:00
const { setOpen } = useArtifacts();
const handleClose = useCallback(() => {
setOpen(false);
}, [setOpen]);
2026-01-17 00:02:03 +08:00
return (
2026-01-17 00:05:19 +08:00
<div className="relative flex size-full items-center justify-center">
<div className="absolute top-1 right-1">
<Button size="icon-sm" variant="ghost" onClick={handleClose}>
<XIcon />
</Button>
</div>
2026-01-17 00:02:03 +08:00
<div className="flex items-center gap-2">
<div>
<FileIcon />
</div>
<div>{filepath}</div>
</div>
</div>
);
}