"use client"; /** * PostActionsFooter — the icon-button row at the bottom of a post card. * * Left cluster: Like · Comment · Reshare * Right cluster: Save to Collection (folder-plus) * * Like / Comment / Reshare are placeholders for now — they fire a * "coming soon" toast on click. Save to Collection mounts the existing * CollectionsDrawer in `existingPostId` mode so the post is attached * directly without creating a duplicate. * * Auth gating is handled per-action via `useAuthGate` — anonymous users * see the in-place auth modal before the underlying action runs. */ import { useState } from "react"; import { FolderPlus, Heart, MessageCircle, Repeat2 } from "lucide-react"; import { toast } from "sonner"; import { cn } from "@/lib/utils"; import { useAuthGate } from "@/components/auth/auth-gate"; import { useMediaQuery } from "@/components/selection-toolbar/shared"; import { CollectionsDrawer } from "@/components/selection-toolbar/collections-drawer"; export function PostActionsFooter({ postID }: { postID: string }) { const { requireAuth } = useAuthGate(); const isMobile = useMediaQuery("(max-width: 767px)"); const [collectionsOpen, setCollectionsOpen] = useState(false); async function withAuth(fn: () => void | Promise) { if (!(await requireAuth())) return; await fn(); } return ( <>
withAuth(() => { toast("Likes are coming soon", { duration: 2000 }); }) } icon={} /> withAuth(() => { toast("Comments are coming soon", { duration: 2000 }); }) } icon={} /> withAuth(() => { toast("Resharing is coming soon", { duration: 2000 }); }) } icon={} />
withAuth(() => setCollectionsOpen(true))} icon={} />
setCollectionsOpen(false)} isMobile={isMobile} existingPostId={postID} /> ); } function ActionButton({ label, onClick, icon, }: { label: string; onClick: () => void; icon: React.ReactNode; }) { return ( ); }