"use client"; import { useAtomValue, useSetAtom } from "jotai"; import { Boxes, XIcon } from "lucide-react"; import { useMemo } from "react"; import { Button } from "@/components/ui/button"; import { Drawer, DrawerContent, DrawerHandle, DrawerTitle } from "@/components/ui/drawer"; import { useMediaQuery } from "@/hooks/use-media-query"; import type { ArtifactKind, ChatArtifact } from "../model/artifact"; import { artifactsPanelOpenAtom, chatArtifactsAtom, closeArtifactsPanelAtom, } from "../state/artifacts-panel.atom"; import { ArtifactRow } from "./artifact-row"; const GROUP_ORDER: { kind: ArtifactKind; label: string }[] = [ { kind: "report", label: "Reports" }, { kind: "resume", label: "Resumes" }, { kind: "podcast", label: "Podcasts" }, { kind: "video", label: "Presentations" }, { kind: "image", label: "Images" }, ]; function groupByKind(artifacts: ChatArtifact[]): { label: string; items: ChatArtifact[] }[] { return GROUP_ORDER.map(({ kind, label }) => ({ label, items: artifacts.filter((a) => a.kind === kind), })).filter((group) => group.items.length > 0); } function EmptyState() { return (
No artifacts yet
Reports, podcasts, presentations, and images you generate will appear here.
{group.label}