import React, { useEffect, useRef } from "react"; import { useParams } from 'react-router-dom'; import CallItem from "./CallItem"; import { Icon, Table, Ref } from "semantic-ui-react"; import "../CallPlayer.css"; import { useGetTalkgroupsQuery } from '../../features/api/apiSlice' // ---------------------------------------------------- const ListCalls = (props) => { const activeCallRef = useRef(); const { shortName } = useParams(); const { data: talkgroupsData, isSuccess: isTalkgroupsSuccess } = useGetTalkgroupsQuery(shortName); //https://stackoverflow.com/questions/36559661/how-can-i-dispatch-from-child-components-in-react-redux //https://stackoverflow.com/questions/42597602/react-onclick-pass-event-with-parameter useEffect(() => { if (activeCallRef.current) { activeCallRef.current.scrollIntoView({ block: "center", }); } }); const callsData = props.callsData; return (