import React from 'react' import LineGrapInput from './LineGrapInput' import BarChartInput from './BarChartInput' import PieChartInput from './PieChartInput' import FlotingWidgetInput from './FlotingWidgetInput' import FleetEfficiencyInputComponent from './FleetEfficiencyInputComponent' import Progress1Input from './Progress1Input' import Progress2Input from './Progress2Input' import Widget2InputCard3D from './Widget2InputCard3D' import Widget3InputCard3D from './Widget3InputCard3D' import Widget4InputCard3D from './Widget4InputCard3D' import WarehouseThroughputInputComponent from './WarehouseThroughputInputComponent' import { useWidgetStore } from '../../../../../store/useWidgetStore' // const InputSelecterComponent = () => { // const { selectedChartId } = useWidgetStore(); // if (selectedChartId && selectedChartId.type && selectedChartId.type === 'bar' ) { // return ( // <> //
2D Widget Input
// // // ) // } // else if (selectedChartId && selectedChartId.type && selectedChartId.type === 'line' ) { // return ( // <> //
2D Widget Input
// // // ) // } // else if (selectedChartId && selectedChartId.type && selectedChartId.type === 'pie' ) { // return ( // <> //
2D Widget Input
// // // ) // } // else if (selectedChartId && selectedChartId.type && selectedChartId.type === 'doughnut' ) { // return ( // <> //
2D Widget Input
// // // ) // } // else if (selectedChartId && selectedChartId.type && selectedChartId.type === 'polarArea' ) { // return ( // <> //
2D Widget Input
// // // ) // } // else if (selectedChartId && selectedChartId.type && selectedChartId.type === 'progress 1' ) { // return ( // <> //
2D Widget Input
// // // ) // } // else if (selectedChartId && selectedChartId.type && selectedChartId.type === 'progress 2' ) { // return ( // <> //
2D Widget Input
// // // ) // } // else if (selectedChartId && selectedChartId.className && selectedChartId.className === 'warehouseThroughput floating' ) { // return ( // <> //
Floting Widget Input
// // // ) // } // else if (selectedChartId && selectedChartId.className && selectedChartId.className === 'fleetEfficiency floating' ) { // return ( // <> //
Floting Widget Input
// // // ) // } // else if (selectedChartId && selectedChartId.className && selectedChartId.className === 'floating total-card' ) { // return ( // <> //
Floting Widget Input
// // // ) // } // else if (selectedChartId && selectedChartId.type && selectedChartId.type === 'ui-Widget 1' ) { // return ( // <> //
3D Widget Input
// // // ) // } // else if (selectedChartId && selectedChartId.type && selectedChartId.type === 'ui-Widget 2' ) { // return ( // <> //
3D Widget Input
// // // ) // } // else if (selectedChartId && selectedChartId.type && selectedChartId.type === 'ui-Widget 3' ) { // return ( // <> //
3D Widget Input
// // // ) // } // else if (selectedChartId && selectedChartId.type && selectedChartId.type === 'ui-Widget 4' ) { // return ( // <> //
3D Widget Input
// // // ) // } // else { // return ( //
No chart selected
// ) // } // } const chartTypeMap: Record<| 'bar'| 'line'| 'pie' | 'doughnut' | 'polarArea'| 'progress 1' | 'progress 2' | 'ui-Widget 1'| 'ui-Widget 2'| 'ui-Widget 3'| 'ui-Widget 4',JSX.Element> = { bar: , line: , pie: , doughnut: , polarArea: , 'progress 1': , 'progress 2': , 'ui-Widget 1': , 'ui-Widget 2': , 'ui-Widget 3': , 'ui-Widget 4': , }; const classNameMap: Record< | 'warehouseThroughput floating' | 'fleetEfficiency floating' | 'floating total-card', JSX.Element > = { 'warehouseThroughput floating': , 'fleetEfficiency floating': , 'floating total-card': , }; const InputSelecterComponent = () => { const { selectedChartId } = useWidgetStore(); if (selectedChartId) { const { type, className } = selectedChartId; if (type && chartTypeMap[type as keyof typeof chartTypeMap]) { const label = ['ui-Widget 1', 'ui-Widget 2', 'ui-Widget 3', 'ui-Widget 4'].includes(type) ? '3D Widget Input' : '2D Widget Input'; return ( <>
{label}
{chartTypeMap[type as keyof typeof chartTypeMap]} ); } if (className && classNameMap[className as keyof typeof classNameMap]) { return ( <>
Floting Widget Input
{classNameMap[className as keyof typeof classNameMap]} ); } } return
No chart selected
; }; export default InputSelecterComponent;