blob: ff05d2d11829945817eb6b6bb3b864657963ac21 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import React, { useCallback } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { devicesActions } from '../../store';
import MapPositions from '../MapPositions';
const MapCurrentPositions = () => {
const dispatch = useDispatch();
const onClick = useCallback((_, deviceId) => {
dispatch(devicesActions.select(deviceId));
}, [dispatch]);
const positions = useSelector((state) => state.positions.items);
return (<MapPositions positions={Object.values(positions)} onClick={onClick} />);
};
export default MapCurrentPositions;
|