import { Scissors, Copy, ClipboardPaste, Download, Trash2, X } from 'lucide-react';
import type { UseFileBrowserAppType } from '../../useFileBrowserApp';

type SelectionActionsProps = {
  fileBrowserManager: UseFileBrowserAppType;
};

export const SelectionActions = ({ fileBrowserManager }: SelectionActionsProps) => {
  const { selected, clipboard, handleCut, handleCopy, handlePaste, handleDownloadSelected, handleDeleteSelected, setSelected } =
    fileBrowserManager;

  return (
    <>
      <span className="text-sm font-medium text-duck-dark/70 mr-1">
        {selected.size}
        <span className="hidden md:inline"> selected</span>
      </span>
      <button
        onClick={handleCut}
        title="Cut"
        className="p-1.5 rounded-md text-duck-teal hover:bg-duck-dark/5 cursor-pointer transition-colors"
      >
        <Scissors className="h-4 w-4" />
      </button>
      <button
        onClick={handleCopy}
        title="Copy"
        className="p-1.5 rounded-md text-duck-teal hover:bg-duck-dark/5 cursor-pointer transition-colors"
      >
        <Copy className="h-4 w-4" />
      </button>
      {clipboard !== null && (
        <button
          onClick={handlePaste}
          title="Paste"
          className="p-1.5 rounded-md text-duck-teal hover:bg-duck-dark/5 cursor-pointer transition-colors"
        >
          <ClipboardPaste className="h-4 w-4" />
        </button>
      )}
      <button
        onClick={handleDownloadSelected}
        title="Download"
        className="p-1.5 rounded-md text-duck-teal hover:bg-duck-dark/5 cursor-pointer transition-colors"
      >
        <Download className="h-4 w-4" />
      </button>
      <button
        onClick={handleDeleteSelected}
        title="Delete"
        className="p-1.5 rounded-md text-red-500 hover:bg-red-50 cursor-pointer transition-colors"
      >
        <Trash2 className="h-4 w-4" />
      </button>
      <button
        onClick={() => setSelected(new Set())}
        title="Clear selection"
        className="p-1.5 rounded-md text-duck-teal hover:bg-duck-dark/5 cursor-pointer transition-colors"
      >
        <X className="h-4 w-4" />
      </button>
    </>
  );
};
