Skip to content

Commit

Permalink
type fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jerem1508 committed Oct 22, 2024
1 parent dd343ed commit 88c22a1
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,17 @@ function MenuModal({
);
}

export default function ChartWrapper({ id, options, legend, renderData }) {
export default function ChartWrapper({
id,
options,
legend,
renderData,
}: {
id: string;
options: Highcharts.Options;
legend: React.ReactNode;
renderData?: (options: Highcharts.Options) => React.ReactNode;
}) {
const [isOpen, setIsOpen] = useState(false);
const [isOpenIntegration, setIsOpenIntegration] = useState(false);
const [displayType, setDisplayType] = useState("chart"); // ["chart", "data"]
Expand Down Expand Up @@ -240,7 +250,7 @@ export default function ChartWrapper({ id, options, legend, renderData }) {
variant="text"
/>
</div>
{displayType === "data" && <>{renderData(options)}</>}
{displayType === "data" && renderData && <>{renderData(options)}</>}
{displayType === "chart" && (
<figure>
<HighchartsReact highcharts={Highcharts} options={options} />
Expand Down

0 comments on commit 88c22a1

Please sign in to comment.