17 lines
500 B
TypeScript
17 lines
500 B
TypeScript
// components/main/kabelueberwachung/kue705FO/handlers/handleCloseChartModal.ts
|
|
import { Chart } from "chart.js";
|
|
|
|
const handleCloseChartModal = (
|
|
setShowChartModal: (value: boolean) => void,
|
|
chartInstance: React.MutableRefObject<Chart | null>
|
|
) => {
|
|
if (chartInstance.current) {
|
|
console.log("Chart wird beim Schließen des Modals zerstört.");
|
|
chartInstance.current.destroy();
|
|
chartInstance.current = null;
|
|
}
|
|
setShowChartModal(false);
|
|
};
|
|
|
|
export default handleCloseChartModal;
|