import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; import { useAuth } from "@/lib/hooks/useAuth"; import { useState } from "react"; import { Button } from "./ui/button"; import { PostView } from "@atproto/api/dist/client/types/app/bsky/feed/defs"; import { LoaderCircle } from "lucide-react"; import { useBoardsStore } from "@/lib/stores/boards"; import { BoardsPicker } from "./BoardPicker"; import { toast } from "sonner"; import { AtUri } from "@atproto/api"; import { LIST_COLLECTION, LIST_ITEM_COLLECTION } from "@/constants"; import { FeedItem } from "./Feed"; import { useCurrentBoard } from "@/lib/stores/useCurrentBoard"; import { useBoardItemsStore } from "@/lib/stores/boardItems"; export function UnsaveButton({ post, image, }: { post: PostView; image: number; }) { const { agent } = useAuth(); const [isLoading, setLoading] = useState(false); const [isOpen, setOpen] = useState(false); const { removeBoardItem, boardItems } = useBoardItemsStore(); if (agent == null) return