import { RefreshCw } from 'lucide-react';
import type { UseFileBrowserAppType } from '../../useFileBrowserApp';
import { SelectionActions } from './SelectionActions';
import { DefaultActions } from './DefaultActions';

type ActionButtonsProps = {
  fileBrowserManager: UseFileBrowserAppType;
};

export const ActionButtons = ({ fileBrowserManager }: ActionButtonsProps) => {
  const { refresh, selected } = fileBrowserManager;

  return (
    <div className="flex items-center gap-1">
      <button
        onClick={refresh}
        title="Refresh"
        className="p-1.5 rounded-md text-duck-teal hover:bg-duck-dark/5 cursor-pointer transition-colors"
      >
        <RefreshCw className="h-4 w-4" />
      </button>
      {selected.size > 0 ? (
        <SelectionActions fileBrowserManager={fileBrowserManager} />
      ) : (
        <DefaultActions fileBrowserManager={fileBrowserManager} />
      )}
    </div>
  );
};
