import React from 'react';
import { ResourceFormModal } from './modal';

interface EditModalProps {
  id?: number;
  onClose: () => void;
  onSuccess?: () => void;
}

export const EditModal: React.FC<EditModalProps> = ({
  id,
  onClose,
  onSuccess,
}) => {
  const handleMutationSuccess = () => {
    onSuccess?.();
    onClose?.();
  };

  return (
    <ResourceFormModal
      action="edit"
      id={id}
      onCancel={onClose}
      onMutationSuccess={handleMutationSuccess}
    />
  );
};
