Update page.tsx

This commit is contained in:
CanbiZ 2025-01-23 11:24:12 +01:00
parent c54180e8fb
commit 86ac765d80

View File

@ -5,6 +5,8 @@ import { Card, CardContent, CardHeader } from "@/components/ui/card";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { Category } from "@/lib/types"; import { Category } from "@/lib/types";
const defaultLogo = "/default-logo.png"; // Fallback logo path
const CategoryView = () => { const CategoryView = () => {
const [categories, setCategories] = useState<Category[]>([]); const [categories, setCategories] = useState<Category[]>([]);
const [selectedCategory, setSelectedCategory] = useState<Category | null>(null); const [selectedCategory, setSelectedCategory] = useState<Category | null>(null);
@ -76,16 +78,16 @@ const CategoryView = () => {
{category.scripts && category.scripts.slice(0, 4).map((script, index) => ( {category.scripts && category.scripts.slice(0, 4).map((script, index) => (
<img <img
key={index} key={index}
src={script.logo} src={script.logo || defaultLogo}
alt={script.name} alt={script.name || "Script logo"}
className="h-6 w-6 object-contain" className="h-6 w-6 object-contain"
/> />
))} ))}
</div> </div>
<h3 className="text-lg font-bold mb-1">{category.name}</h3> <h3 className="text-lg font-bold mb-1">{category.name}</h3>
{category.description && ( <p className="text-sm text-gray-500 text-center">
<p className="text-sm text-gray-500 text-center">{category.description}</p> {category.description || "No description available."}
)} </p>
</CardContent> </CardContent>
</Card> </Card>
))} ))}