// components import Spring from '@components/Spring'; import LegendItem from '@ui/LegendItem'; import {ResponsiveContainer, Scatter, ScatterChart, ReferenceLine, Cell, Tooltip, XAxis} from 'recharts'; import ClubInfo from '@components/ClubInfo'; import TabButton from '@ui/TabButton'; import ChartTooltip from '@ui/ChartTooltip'; // hooks import {useState} from 'react'; import {useThemeProvider} from '@contexts/themeContext'; const data = { first: [ {target: 61, miss: 20}, {target: 92, miss: 43}, {target: 49, miss: 39}, {target: 84, miss: 27}, {target: 83, miss: 45}, {target: 43, miss: 17}, {target: 87, miss: 10}, {target: 78, miss: 56}, {target: 15, miss: 34}, {target: 48, miss: 14}, {target: 74, miss: 18}, {target: 35, miss: 92} ], second: [ {target: 70, miss: 27}, {target: 43, miss: 57}, {target: 53, miss: 27}, {target: 14, miss: 71}, {target: 23, miss: 19}, {target: 75, miss: 92}, {target: 33, miss: 15}, {target: 26, miss: 28}, {target: 97, miss: 32}, {target: 25, miss: 34}, {target: 84, miss: 12}, {target: 93, miss: 41} ] } const ShotsStats = () => { const [selectedHalf, setSelectedHalf] = useState('first'); const {direction} = useThemeProvider(); const isRTL = direction === 'rtl'; const infoStyles = { position: 'absolute', bottom: 0, } const CustomScatterShape = ({cx, cy, fill, ...props}) => { const isDominant = props.dom === props.dataKey; return ( { isDominant && <> } ); } return (
setSelectedHalf('first')}/> setSelectedHalf('second')}/>
{ data[selectedHalf].map((entry, index) => { return ( entry.target ? 'miss' : 'target'} dataKey="miss"/> ) }) } { data[selectedHalf].map((entry, index) => { return ( entry.target ? 'miss' : 'target'} dataKey="target"/> ) }) }
18 shots
) } export default ShotsStats