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

interface CreateButtonProps {
  label: string;
  path: string;
}

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

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