"use client"; import { X } from "lucide-react"; import { AnimatePresence, motion, useReducedMotion } from "motion/react"; import type { ReactNode } from "react"; import { EASE_OUT } from "@/lib/ease"; import { cn } from "@/lib/utils"; export interface SelectionActionsProps { /** How many items are selected. The bar hides itself at 0. */ count: number; onClear?: () => void; /** Action buttons, such as icon buttons for delete or tag. */ children: ReactNode; className?: string; } /** * A bar for bulk actions that floats over the page rather than sitting in * flow, so rows in a Table (or any list) above it never jump when it * appears or disappears. Fixed to the bottom of the viewport, centered. * Fades and rises in once count leaves zero, and back out once the * selection clears. */ export function SelectionActions({ count, onClear, children, className }: SelectionActionsProps) { const reduce = useReducedMotion(); return ( {count > 0 ? ( {count} selected
{children}
) : null} ); }