mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-19 20:34:45 +08:00
feat: set artifacts layout
This commit is contained in:
@@ -1,23 +1,22 @@
|
||||
import { FileIcon, XIcon } from "lucide-react";
|
||||
import { useCallback } from "react";
|
||||
import { FileIcon } from "lucide-react";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
import { useArtifacts } from "./context";
|
||||
|
||||
export function ArtifactFileDetail({ filepath }: { filepath: string }) {
|
||||
const { setOpen } = useArtifacts();
|
||||
const handleClose = useCallback(() => {
|
||||
setOpen(false);
|
||||
}, [setOpen]);
|
||||
export function ArtifactFileDetail({
|
||||
className,
|
||||
filepath,
|
||||
}: {
|
||||
className?: string;
|
||||
filepath: string;
|
||||
}) {
|
||||
return (
|
||||
<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>
|
||||
<div className="flex items-center gap-2">
|
||||
<div
|
||||
className={cn(
|
||||
"relative flex size-full items-center justify-center",
|
||||
className,
|
||||
)}
|
||||
>
|
||||
<div className="flex size-fit items-center gap-2">
|
||||
<div>
|
||||
<FileIcon />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user