"use client"; import { Sandbox } from "@/lib/types"; import ProjectCard from "./projectCard"; import Image from "next/image"; import ProjectCardDropdown from "./projectCard/dropdown"; import { Clock, Globe, Lock } from "lucide-react"; import Link from "next/link"; import { Card } from "../ui/card"; import { deleteSandbox, updateSandbox } from "@/lib/actions"; import { toast } from "sonner"; export default function DashboardProjects({ sandboxes, q, }: { sandboxes: Sandbox[]; q: string | null; }) { const onDelete = async (sandbox: Sandbox) => { toast(`Project ${sandbox.name} deleted.`); await deleteSandbox(sandbox.id); }; const onVisibilityChange = async (sandbox: Sandbox) => { const newVisibility = sandbox.visibility === "public" ? "private" : "public"; toast(`Project ${sandbox.name} is now ${newVisibility}.`); await updateSandbox({ id: sandbox.id, visibility: newVisibility, }); }; return (