import { Button, Grid } from "@mui/material";
import useCategories from "@/lib/callWidget/hooks/useCategories";

const CallActionCategoriesButton = ({ category, tab }) => {
    const { setActiveCategoryID } = useCategories();

    return (
        
            <Grid item xs={4}>
                <Button
                sx={{py : 1.5}}
                    fullWidth
                    variant={"contained"}
                    color={tab.active_category_id === category.category_id ? "primary" : "inherit"}
                    onClick={() => {
                        setActiveCategoryID(tab.id, category.category_id);
                    }}
                >
                    {category.category_name}
                </Button>
            </Grid>
        
    );
};
export default CallActionCategoriesButton;
