mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 20:42:02 +00:00
fix: add sample data to RadarChartWithSelection component
This commit is contained in:
@@ -1,26 +1,38 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
|
||||
import { RadarChart } from "@/components/graphs";
|
||||
import type { RadarDataPoint } from "@/components/graphs/types";
|
||||
|
||||
interface RadarChartWithSelectionProps {
|
||||
percentage?: number;
|
||||
label?: string;
|
||||
color?: string;
|
||||
data?: RadarDataPoint[];
|
||||
height?: number;
|
||||
}
|
||||
|
||||
const sampleRadarData: RadarDataPoint[] = [
|
||||
{ category: "IAM", value: 85, change: 5 },
|
||||
{ category: "Storage", value: 72, change: -2 },
|
||||
{ category: "Network", value: 88, change: 8 },
|
||||
{ category: "Compute", value: 76, change: 3 },
|
||||
{ category: "Database", value: 82, change: -1 },
|
||||
{ category: "Encryption", value: 91, change: 6 },
|
||||
];
|
||||
|
||||
export function RadarChartWithSelection({
|
||||
percentage = 78,
|
||||
label = "Overall Compliance",
|
||||
color = "var(--chart-success-color)",
|
||||
height = 350,
|
||||
data = sampleRadarData,
|
||||
height = 400,
|
||||
}: RadarChartWithSelectionProps) {
|
||||
const [selectedPoint, setSelectedPoint] = useState<RadarDataPoint | null>(
|
||||
null,
|
||||
);
|
||||
|
||||
return (
|
||||
<RadarChart
|
||||
percentage={percentage}
|
||||
label={label}
|
||||
color={color}
|
||||
data={data}
|
||||
height={height}
|
||||
selectedPoint={selectedPoint}
|
||||
onSelectPoint={setSelectedPoint}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user