import {
  LinkIcon,
  Loader2,
  Trash2,
  UploadIcon,
} from 'lucide-react';
import { BiMicrophone } from 'react-icons/bi';

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

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

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

        </>
      )}
    </Button>
    <Button
      variant='ghost'
      tooltip={Lang.key('record_audio')}
      aria-label={Lang.key('record_audio')}
      onClick={(e) => {
        e.preventDefault();
        onRecordAudio();
      }}
    >
      <BiMicrophone />
    </Button>
    <Button
      variant='ghost'
      tooltip={Lang.key('copy_link')}
      aria-label={Lang.key('copy_link')}
      onClick={(e) => {
        e.preventDefault();
        onCopyLink();
      }}
    >
      <LinkIcon />

    </Button>
  </div>
);
