mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-05 23:39:16 +00:00
Update index.tsx
This commit is contained in:
parent
405b844c37
commit
a59f1cce8f
@ -1,10 +1,13 @@
|
|||||||
|
// Folder: category-view
|
||||||
|
// File: index.tsx
|
||||||
|
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
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 { fetchCategories } from "@/lib/data";
|
import { fetchCategories } from "@/lib/data";
|
||||||
import { Category } from "@/lib/types";
|
import { Category, Script } from "@/lib/types";
|
||||||
|
|
||||||
const CategoryView = () => {
|
const CategoryView = () => {
|
||||||
const [categories, setCategories] = useState<Category[]>([]);
|
const [categories, setCategories] = useState<Category[]>([]);
|
||||||
@ -35,11 +38,13 @@ const CategoryView = () => {
|
|||||||
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4">
|
<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: Script) => (
|
||||||
<Card key={script.name}>
|
<Card key={script.name}>
|
||||||
<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_created || "No date available"}
|
||||||
|
</p>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
))}
|
))}
|
||||||
@ -65,4 +70,4 @@ const CategoryView = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default CategoryView;
|
export default CategoryView;
|
Loading…
Reference in New Issue
Block a user