"use client";

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

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

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

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