import React, { useCallback } from 'react'; import { SelectActionType, useSelect } from 'App/SelectContext'; import IconButton from 'Components/Link/IconButton'; import { icons } from 'Helpers/Props'; import styles from './ArtistIndexPosterSelect.css'; interface ArtistIndexPosterSelectProps { artistId: number; } function ArtistIndexPosterSelect(props: ArtistIndexPosterSelectProps) { const { artistId } = props; const [selectState, selectDispatch] = useSelect(); const isSelected = selectState.selectedState[artistId]; const onSelectPress = useCallback( (event) => { const shiftKey = event.nativeEvent.shiftKey; selectDispatch({ type: SelectActionType.ToggleSelected, id: artistId, isSelected: !isSelected, shiftKey, }); }, [artistId, isSelected, selectDispatch] ); return ( ); } export default ArtistIndexPosterSelect;