import { Button } from '../ui'

export function UnlockAccountButtons(params: {
  loading: boolean
  words: string[]
  onUnlock: () => void
  onClose: () => void
}): React.ReactElement {
  return (
    <div className="flex gap-4">
      <Button
        type="button"
        variant="secondary"
        onClick={params.onClose}
        className="flex-1"
      >
        Annuler
      </Button>
      <Button
        type="button"
        variant="primary"
        onClick={params.onUnlock}
        disabled={params.loading || params.words.some((word) => !word)}
        loading={params.loading}
        className="flex-1"
      >
        {params.loading ? 'Déverrouillage...' : 'Déverrouiller'}
      </Button>
    </div>
  )
}
