import React from 'react' import { Button } from './Button' export interface BulkAction { label: string icon?: string onClick: () => void variant?: 'primary' | 'secondary' | 'danger' } export interface BulkActionBarProps { selectedCount: number onClearSelection: () => void actions: BulkAction[] position?: 'bottom-floating' | 'bottom-sticky' | 'top-floating' theme?: 'dark' | 'light' className?: string } const positionClass: Record, string> = { 'bottom-floating': 'fixed bottom-4 left-1/2 -translate-x-1/2', 'bottom-sticky': 'sticky bottom-4', 'top-floating': 'fixed top-16 left-1/2 -translate-x-1/2', } export const BulkActionBar: React.FC = ({ selectedCount, onClearSelection, actions, position = 'bottom-floating', theme = 'dark', className = '', }) => { const isDark = theme === 'dark' const containerClass = isDark ? 'bg-slate-900 text-white' : 'bg-white border border-slate-200 text-slate-800' const countClass = isDark ? 'text-teal-300' : 'text-teal-600' return (
0 ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-4 pointer-events-none'} ${className} `} role="region" aria-label="일괄 액션" >
{/* Count + Clear */}
{selectedCount}개 선택
{/* Actions */}
{actions.map((action, index) => { const variant = action.variant ?? 'secondary' const dsVariant = variant === 'secondary' ? 'ghost' : variant const darkSecondaryClass = isDark && variant === 'secondary' ? 'text-slate-300 hover:text-white hover:bg-slate-700' : '' return ( ) })}
) }