import {
  LinkIcon,
  Loader2,
  Trash2,
  UploadIcon,
} from 'lucide-react';

import { Button } from '@/components/ui/button';
import { Lang } from '@/lang/Lang';

type FileDataImageEditActionsProps = {
  uploading: boolean;
  buttonTitle: string;
  isMobile: boolean;
  col: number;
  onDelete: () => void;
  onUpload: () => void;
  onCopyLink: () => void;
};

export const FileDataImageEditActions = ({
  uploading,
  buttonTitle,
  isMobile,
  col,
  onDelete,
  onUpload,
  onCopyLink,
}: FileDataImageEditActionsProps) => (
  <div className='flex items-center gap-2'>
    <Button
      variant='ghost'
      size='icon'
      onClick={(e) => {
        e.preventDefault();
        onDelete();
      }}
    >
      <Trash2 />
    </Button>
    <Button
      variant='ghost'
      onClick={(e) => {
        e.preventDefault();
        onUpload();
      }}
    >
      {uploading ? (
        <>
          <Loader2 className='size-4 animate-spin' />
          {Lang.key('uploading_file_wait')}
        </>
      ) : (
        <>
          <UploadIcon />

        </>
      )}
    </Button>
    <Button
      variant='ghost'
      onClick={(e) => {
        e.preventDefault();
        onCopyLink();
      }}
    >
      <LinkIcon />

    </Button>
  </div>
);
