// Folder: category-view // File: index.tsx import React, { useState } from 'react'; import { Card, CardContent, CardHeader } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; import { Grid } from '@/components/ui/grid'; import routes from '@/routes'; // Assuming your route.ts file is at this location const CategoryView = () => { const [selectedCategory, setSelectedCategory] = useState(null); const handleCategoryClick = (category) => { setSelectedCategory(category); }; const handleBackClick = () => { setSelectedCategory(null); }; const categories = routes.map((route) => ({ name: route.category, scripts: route.scripts.map((script) => ({ name: script.name, date: script.date || 'N/A', // Assuming scripts have a `date` field })), })); return (
{script.date}