import { useCallback } from 'react'; import clsx from 'clsx'; import { useAutoAnimate } from '@formkit/auto-animate/react'; import { useMapRootState } from '@/hooks/Mapper/mapRootProvider'; import { Commands } from '@/hooks/Mapper/types/mapHandlers.ts'; import { CharacterTypeRaw } from '@/hooks/Mapper/types'; const Characters = ({ data }: { data: CharacterTypeRaw[] }) => { const [parent] = useAutoAnimate(); const { mapRef } = useMapRootState(); const handleSelect = useCallback( (character: CharacterTypeRaw) => { mapRef.current?.command(Commands.centerSystem, character?.location?.solar_system_id?.toString()); }, [mapRef], ); const items = data.map(character => (
  • handleSelect(character)} >
  • )); return ( ); }; // eslint-disable-next-line react/display-name export default Characters;