"use client" import * as React from "react" import { Plus, TrendingUp, Wallet, Receipt } from "lucide-react" import { cn } from "@/lib/utils" import { Button } from "@/components/ui/button" interface FABAction { icon: React.ReactNode label: string onClick: () => void variant?: "default" | "outline" | "secondary" } interface FloatingActionButtonProps { actions: FABAction[] className?: string } export function FloatingActionButton({ actions, className }: FloatingActionButtonProps) { const [isOpen, setIsOpen] = React.useState(false) const toggleMenu = () => setIsOpen(!isOpen) const handleActionClick = (action: FABAction) => { action.onClick() setIsOpen(false) } return ( <> {/* Backdrop Overlay */} {isOpen && (
setIsOpen(false)} /> )} {/* FAB Container */}
{/* Main FAB Button - Always at bottom */} {/* Action Menu - Above main button */} {isOpen && (
{actions.map((action, index) => (
{/* Label */} {action.label} {/* Action Button */}
))}
)}
) } // Export icons for convenience export { TrendingUp as FABTrendingUpIcon, Wallet as FABWalletIcon, Receipt as FABReceiptIcon }