"use client";

import { DonutChart, Legend } from "@tremor/react";

const dataFormatter = (number: number) => Intl.NumberFormat("de-DE").format(number).toString();

interface LoadFactorChartProps {
	// biome-ignore lint/suspicious/noExplicitAny: temp. fix
	data: any[];
}
export function LoadFactorChart(props: LoadFactorChartProps) {
	const { data } = props;

	return (
		<div className="flex gap-4">
			<DonutChart data={data} variant="donut" colors={["green", "yellow"]} valueFormatter={dataFormatter} />
			<Legend categories={["Frei", "Belegt"]} colors={["green", "yellow"]} className="max-w-xs" />
		</div>
	);
}
