mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-17 11:21:35 +03:00
39 lines
785 B
TypeScript
39 lines
785 B
TypeScript
|
"use client";
|
||
|
import { FC } from "react";
|
||
|
import {
|
||
|
VictoryContainer,
|
||
|
VictoryPie,
|
||
|
VictoryPieProps,
|
||
|
VictoryTheme,
|
||
|
} from "victory";
|
||
|
|
||
|
interface BrainSpaceChartProps extends VictoryPieProps {
|
||
|
current_brain_size: number;
|
||
|
max_brain_size: number;
|
||
|
}
|
||
|
|
||
|
const BrainSpaceChart: FC<BrainSpaceChartProps> = ({
|
||
|
current_brain_size,
|
||
|
max_brain_size,
|
||
|
...props
|
||
|
}) => {
|
||
|
return (
|
||
|
<VictoryPie
|
||
|
data={[
|
||
|
{ x: "Used", y: current_brain_size },
|
||
|
{ x: "Unused", y: max_brain_size - current_brain_size },
|
||
|
]}
|
||
|
containerComponent={
|
||
|
<VictoryContainer
|
||
|
className="bg-white rounded-md w-full h-full"
|
||
|
responsive={true}
|
||
|
/>
|
||
|
}
|
||
|
{...props}
|
||
|
theme={VictoryTheme.material}
|
||
|
/>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default BrainSpaceChart;
|