Update script item to take advantage of new API data

This commit is contained in:
Bram Suurd
2024-05-28 20:26:10 +02:00
parent c244dd06ae
commit 7904b5a4b6
2 changed files with 19 additions and 2 deletions

View File

@@ -230,7 +230,7 @@ function ScriptItem({
</div>
</div>
<div className="hidden flex-col justify-between gap-2 sm:flex">
<div>
<div className="flex flex-col gap-2">
{item.port !== 0 && (
<div className="flex items-center justify-end">
<h2 className="mr-2 text-end text-lg font-semibold">
@@ -244,7 +244,21 @@ function ScriptItem({
{item.port}
</Button>
</div>
)}
)}
{item.interface != 0 && (
<div className="flex items-center justify-end">
<h2 className="mr-2 text-end text-lg font-semibold">
Interface:
</h2>{" "}
<Button
variant={"secondary"}
size={"sm"}
onClick={() => handleCopy("interface", item.interface)}
>
{item.interface}
</Button>
</div>
)}
</div>
<div className="flex justify-end gap-2">
{item.website && (

View File

@@ -1,3 +1,5 @@
import { StringToBoolean } from "class-variance-authority/types";
export type ScriptProps = {
scriptID: string;
};
@@ -31,6 +33,7 @@ export type Script = {
website: string;
isMostViewed: boolean;
mostViewedPosition: number;
interface: string;
};
export interface Category {