mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-02-01 17:31:49 +00:00
Update index.tsx
This commit is contained in:
parent
9f29a66bb7
commit
c7a0009d9a
@ -3,7 +3,6 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { Card, CardContent, CardHeader } from "@/components/ui/card";
|
import { Card, CardContent, CardHeader } from "@/components/ui/card";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Grid } from "@mui/material";
|
|
||||||
import { fetchCategories } from "@/lib/data";
|
import { fetchCategories } from "@/lib/data";
|
||||||
import { Category } from "@/lib/types";
|
import { Category } from "@/lib/types";
|
||||||
|
|
||||||
@ -33,40 +32,37 @@ const CategoryView = () => {
|
|||||||
Back to Categories
|
Back to Categories
|
||||||
</Button>
|
</Button>
|
||||||
<h2 className="text-xl font-semibold mb-4">{selectedCategory.name}</h2>
|
<h2 className="text-xl font-semibold mb-4">{selectedCategory.name}</h2>
|
||||||
<Grid container spacing={3}>
|
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4">
|
||||||
{selectedCategory.scripts
|
{selectedCategory.scripts
|
||||||
.sort((a, b) => a.name.localeCompare(b.name))
|
.sort((a, b) => a.name.localeCompare(b.name))
|
||||||
.map((script) => (
|
.map((script) => (
|
||||||
<Grid item xs={12} sm={6} md={4} key={script.name}>
|
<Card key={script.name}>
|
||||||
<Card>
|
<CardContent>
|
||||||
<CardContent>
|
<h3 className="text-lg font-medium">{script.name}</h3>
|
||||||
<h3 className="text-lg font-medium">{script.name}</h3>
|
<p className="text-sm text-gray-600">{script.date || "N/A"}</p>
|
||||||
<p className="text-sm text-gray-600">{script.date || "N/A"}</p>
|
</CardContent>
|
||||||
</CardContent>
|
</Card>
|
||||||
</Card>
|
|
||||||
</Grid>
|
|
||||||
))}
|
))}
|
||||||
</Grid>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-2xl font-bold mb-6">Categories</h1>
|
<h1 className="text-2xl font-bold mb-6">Categories</h1>
|
||||||
<Grid container spacing={3}>
|
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4">
|
||||||
{categories.map((category) => (
|
{categories.map((category) => (
|
||||||
<Grid item xs={12} sm={6} md={4} key={category.name}>
|
<Card
|
||||||
<Card
|
key={category.name}
|
||||||
onClick={() => handleCategoryClick(category)}
|
onClick={() => handleCategoryClick(category)}
|
||||||
className="cursor-pointer hover:shadow-lg"
|
className="cursor-pointer hover:shadow-lg"
|
||||||
>
|
>
|
||||||
<CardHeader title={category.name} className="text-lg font-semibold" />
|
<CardHeader title={category.name} className="text-lg font-semibold" />
|
||||||
</Card>
|
</Card>
|
||||||
</Grid>
|
|
||||||
))}
|
))}
|
||||||
</Grid>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default CategoryView;
|
export default CategoryView;
|
Loading…
x
Reference in New Issue
Block a user