import { Button, Grid } from "@mui/material";
import { Controller } from "react-hook-form";

const CallActionCategoriesButton = ({ category, control }) => {
  return (
    <Controller
      control={control}
      render={({ field, fieldState: { error } }) => (
        <Button
          sx={{ py: 1.5 }}
          fullWidth
          variant={
            field.value === category.category_id ? "contained" : "outlined"
          }
          color={"primary"}
          onClick={() => {
            field.onChange(category.category_id);
          }}
        >
          {category.category_name}
        </Button>
      )}
      name={"category_id"}
    />
  );
};
export default CallActionCategoriesButton;
