import { FaPencilAlt } from 'react-icons/fa'
import { FaRegTrashCan } from 'react-icons/fa6'

interface Props {
  studyYearId: string
  onEdit: (studyYearId: string) => void
  onDelete: (studyYearId: string) => void
}

export const ActionButtons = ({ studyYearId, onEdit, onDelete }: Props) => {
  const handleEdit = () => onEdit(studyYearId)

  const handleDelete = () => onDelete(studyYearId)

  return (
    <div className="flex space-x-3 justify-center">
      <button
        className="text-blue-600 hover:underline flex items-center space-x-1"
        onClick={handleEdit}>
        <FaPencilAlt />
        <span>Editar</span>
      </button>
      <button
        className="text-red-600 hover:underline flex items-center space-x-1"
        onClick={handleDelete}>
        <FaRegTrashCan />
        <span>Eliminar</span>
      </button>
    </div>
  )
}
