import {SecuritySummaryReportResultType} from "@/types/security-summary";
import {Card, CardContent, CardHeader, CardTitle} from "@/Components/ui/card";
import {DatabaseZap} from "lucide-react";
import React from "react";

export default function ServicesCdnCard({ reportData }: { reportData: SecuritySummaryReportResultType }) {
    return (
        <Card>
            <CardHeader>
                <CardTitle className="flex items-center gap-2">
                    <DatabaseZap className="w-5 h-5"/>
                    CDN
                </CardTitle>
            </CardHeader>
            <CardContent>
                <div
                    className="text-3xl font-bold">{reportData.cdn.count}</div>
                <div className="text-xs text-muted-foreground mt-1">
                    <div><span className="font-bold">CDN assets:</span></div>
                    <div className="flex flex-col gap-2 mt-3">
                        {reportData.cdn.assets.map((cdn_asset,index) => (
                            <code key={index}>{cdn_asset}</code>
                        ))}
                    </div>

                </div>
            </CardContent>
        </Card>
    )
}
