@pagamio/frontend-commons-lib
Version:
Pagamio library for Frontend reusable components like the form engine and table container
17 lines (16 loc) • 523 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import ReactApexChart from 'react-apexcharts';
import { useEffect, useState } from 'react';
import { Loader } from '../ui';
// TODO: Define proper props type
const Chart = (props) => {
const [mounted, setMounted] = useState(false);
useEffect(() => {
setMounted(true);
}, []);
if (!mounted) {
return _jsx(Loader, { colorClassName: "primary-500" });
}
return _jsx(ReactApexChart, { ...props, width: "100%" });
};
export default Chart;