MCPcopy Create free account
hub / github.com/code100x/daily-code / ButtonCategory

Function ButtonCategory

apps/web/components/Categories.tsx:78–98  ·  view source on GitHub ↗
({ categories, selectedCategory, handleCategoryChange }: CategoryProps)

Source from the content-addressed store, hash-verified

76};
77
78const ButtonCategory = ({ categories, selectedCategory, handleCategoryChange }: CategoryProps) => {
79 return (
80 <div className="flex justify-evenly mx-auto border-2 rounded-full py-1 w-2/3">
81 <Button variant="ghost" className="rounded-full" onClick={() => handleCategoryChange("All")}>
82 All
83 </Button>
84 {categories.map((category) => (
85 <Button
86 key={category.category}
87 variant="ghost"
88 onClick={() => handleCategoryChange(category.category)}
89 className={
90 selectedCategory === category.category ? "bg-gray-300 dark:bg-slate-700 rounded-full" : "rounded-full"
91 }
92 >
93 {category.category}
94 </Button>
95 ))}
96 </div>
97 );
98};

Callers

nothing calls this directly

Calls 1

handleCategoryChangeFunction · 0.85

Tested by

no test coverage detected