import { Button } from "@mui/material";
import { Plus } from "lucide-react";
import { useNavigate } from "react-router-dom";

interface CreateButtonProps {
  label: string;
  path: string;
  disabled?: boolean;
}

export const CreateButton = ({ label, path, disabled }: CreateButtonProps) => {
  const navigate = useNavigate();

  return (
    <Button
      variant="contained"
      color="primary"
      onClick={() => {
        navigate(path);
      }}
      startIcon={<Plus size={20} />}
      disabled={disabled}
    >
      {label}
    </Button>
  );
};
