mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-10 01:39:17 +00:00
Update page.tsx
This commit is contained in:
parent
47bf8e6f86
commit
adfbff63bc
@ -85,6 +85,14 @@ const CategoryView = () => {
|
|||||||
) : null;
|
) : null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const renderType = (type: string) => {
|
||||||
|
return (
|
||||||
|
<span className="text-xs font-semibold text-blue-500 bg-gray-200 px-2 py-1 rounded-full">
|
||||||
|
{type.toUpperCase()}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="p-6 mt-20">
|
<div className="p-6 mt-20">
|
||||||
{categories.length === 0 && (
|
{categories.length === 0 && (
|
||||||
@ -122,25 +130,19 @@ const CategoryView = () => {
|
|||||||
onClick={() => handleScriptClick(script.slug)}
|
onClick={() => handleScriptClick(script.slug)}
|
||||||
>
|
>
|
||||||
<CardContent className="flex flex-col gap-4">
|
<CardContent className="flex flex-col gap-4">
|
||||||
<div className="flex items-center gap-4">
|
<div className="flex justify-between">
|
||||||
<img
|
|
||||||
src={script.logo || defaultLogo}
|
|
||||||
alt={script.name}
|
|
||||||
className="h-12 w-12 object-contain"
|
|
||||||
/>
|
|
||||||
<div>
|
|
||||||
<h3 className="text-lg font-bold">{script.name}</h3>
|
<h3 className="text-lg font-bold">{script.name}</h3>
|
||||||
|
{renderType(script.type || "MISC")}
|
||||||
|
</div>
|
||||||
<p className="text-sm text-gray-500">
|
<p className="text-sm text-gray-500">
|
||||||
<b>Created at:</b> {script.date_created || "No date available"}
|
<b>Created at:</b> {script.date_created || "No date available"}
|
||||||
</p>
|
</p>
|
||||||
<p
|
<p
|
||||||
className="text-sm text-gray-700"
|
className="text-sm text-gray-700 hover:text-gray-900"
|
||||||
title={script.description || "No description available."}
|
title={script.description || "No description available."}
|
||||||
>
|
>
|
||||||
{truncateDescription(script.description || "No description available.")}
|
{truncateDescription(script.description || "No description available.")}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{renderResources(script)}
|
{renderResources(script)}
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
@ -162,9 +164,9 @@ const CategoryView = () => {
|
|||||||
<div>
|
<div>
|
||||||
{/* Categories Grid */}
|
{/* Categories Grid */}
|
||||||
<div className="flex justify-between items-center mb-8">
|
<div className="flex justify-between items-center mb-8">
|
||||||
<h1 className="text-4xl font-bold">Categories</h1>
|
<h1 className="text-3xl font-semibold mb-4">Categories</h1>
|
||||||
<p className="text-sm text-gray-500">
|
<p className="text-sm text-gray-500">
|
||||||
{categories.reduce((acc, cat) => acc + (cat.scripts?.length || 0), 0)} Total scripts
|
{new Set(categories.flatMap((cat) => cat.scripts.map((s) => s.slug))).size} Total scripts
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-8">
|
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-8">
|
||||||
|
Loading…
Reference in New Issue
Block a user