import { Button, Grid, makeStyles } from '@material-ui/core' import { CheckBox, CheckBoxOutlineBlank } from '@material-ui/icons'; import React, { useMemo } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import DpAlert from '../../../../layouts/mui/DpAlert'; import H24Player from './H24Player'; import LegendCommon from './LegendCommon'; const useStyles = makeStyles({ root: { color: '#fff', padding: '0.8rem 0', }, tool: { marginBottom: '1.2rem', }, buttons: { backgroundColor: 'red', flexShrink: 0, }, legend: { backgroundColor: 'green', }, checklabel: { justifyContent: 'flex-start', } }) function WF() { const classes = useStyles(); const dispatch = useDispatch(); let contourSetting = useSelector(s => s.runtime.layerSetting.contour); const { type, outdated, strtm } = useMemo(() => { let type = contourSetting?.type; const ret = { type }; if (type === 'wf24h') { ret.strtm = contourSetting?.tm; ret.outdated = false; } else if (type === 'wf2h') { ret.strtm = contourSetting?.tm; ret.outdated = false; } return ret; }, [contourSetting]); const genWeatherContour24H = () => { dispatch.shyjview.showWeather24h(); } const genWeatherContourRadar = () => { dispatch.shyjview.showWeatherRadar(); } const setIndexH24 = (index) => { let newContourSetting = { ...contourSetting }; if (typeof index === 'number') { newContourSetting.index = index + 1; } else { newContourSetting.index = 0; } dispatch.runtime.setLayerSetting({ contour: newContourSetting }) } return (