mirror of
https://github.com/QuivrHQ/quivr.git
synced 2025-01-05 14:54:25 +03:00
1d7bc8a5bc
* remove duplicate import * 🚧 add new linter configuration * 🧑💻 add and run prettier * 🐛 add babel parser for linter * 🧑💻 add lint-fix command * 🚨 use lint-fix * 🚨 remove 'FC' as a type. Use const and JSX.Element * 🚨 enforce arrow function rule from linter * 🔥 delete unused file * 🚨 adding /* eslint-disable */ in failing files * 💩 add ts-expect-error to Victory components
41 lines
857 B
TypeScript
41 lines
857 B
TypeScript
"use client";
|
|
import {
|
|
VictoryContainer,
|
|
VictoryPie,
|
|
VictoryPieProps,
|
|
VictoryTheme,
|
|
} from "victory";
|
|
|
|
interface BrainSpaceChartProps extends VictoryPieProps {
|
|
current_brain_size: number;
|
|
max_brain_size: number;
|
|
}
|
|
|
|
const BrainSpaceChart = ({
|
|
current_brain_size,
|
|
max_brain_size,
|
|
...props
|
|
}: BrainSpaceChartProps): JSX.Element => {
|
|
return (
|
|
<>
|
|
{/* @ts-expect-error Server Component */}
|
|
<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;
|