import Modal, { ModalActions } from '@/components/ui/Modal'
import { WarningIcon } from '@/components/ui/icons'

interface DriveErrorModalProps {
  error: string
  onCancel: () => void
  onContinue: () => void
  disabled?: boolean
}

export default function DriveErrorModal({
  error,
  onCancel,
  onContinue,
  disabled = false,
}: DriveErrorModalProps) {
  return (
    <Modal ariaLabelledBy="drive-error-title">
      <div className="flex items-center gap-3">
        <div className="w-10 h-10 rounded-full bg-red-900/30 flex items-center justify-center shrink-0">
          <WarningIcon className="w-5 h-5 text-red-400" />
        </div>
        <div>
          <h3 id="drive-error-title" className="text-sm font-semibold text-gray-100">
            Erreur Drive
          </h3>
          <p className="text-xs text-gray-400 mt-0.5">
            L&apos;archivage sur le Drive a echoue. Les fichiers n&apos;ont pas ete versionnes.
          </p>
        </div>
      </div>

      <div className="bg-black-800 border border-white/10 rounded-xl p-3">
        <p className="text-xs text-red-400 font-mono break-all">{error}</p>
      </div>

      <p className="text-xs text-gray-400">
        Voulez-vous quand meme envoyer les fichiers aux devs via Git ?
      </p>

      <ModalActions
        cancelLabel="Annuler"
        confirmLabel="Envoyer sur Git seulement"
        onCancel={onCancel}
        onConfirm={onContinue}
        disabled={disabled}
      />
    </Modal>
  )
}
