22 lines
833 B
TypeScript
Raw Normal View History

2025-05-18 13:31:25 +02:00
"use client"
import { useRouter } from "next/navigation";
2025-05-18 16:09:03 +02:00
import { Site } from "@/app/types";
2025-05-18 13:31:25 +02:00
2025-05-18 16:09:03 +02:00
export default function Sites({ id, name, description, networks }: Site) {
2025-05-18 13:31:25 +02:00
const router = useRouter();
2025-05-18 12:06:21 +02:00
return (
<div className="card bg-base-200 shadow-xl">
<div className="card-body">
<h2 className="card-title">{name}</h2>
<p>{description}</p>
2025-05-18 12:17:18 +02:00
{ networks && networks.length > 0 && (
2025-05-18 15:44:55 +02:00
<p>Networks: {networks.map((network) => network.name).join(", ")}</p>
2025-05-18 12:17:18 +02:00
)}
<div className="card-actions justify-end">
2025-05-18 13:31:25 +02:00
<button className="btn btn-secondary btn-sm btn-outline" onClick={() => router.push(`/dashboard/sites/${id}`)}>View</button>
2025-05-18 12:17:18 +02:00
</div>
2025-05-18 12:06:21 +02:00
</div>
</div>
)
}