import React, { useState } from "react"; import { Header, Divider, List, Segment, Statistic, Icon, Menu, Tab } from "semantic-ui-react"; import PlaylistBuilder from "./PlaylistBuilder" // ---------------------------------------------------- function CallInfo(props) { let srcList = ""; let callLength = "-"; let callFreq = "-"; let callDate = "-"; let callTime = "-"; let talkgroupNum = "-"; let callDownload = ""; let callTweet = ""; if (props.call) { const currentCall = props.call; var time = new Date(currentCall.time); callTime = time.toLocaleTimeString(); callDate = time.toLocaleDateString(); if (currentCall.freq) { var freq = currentCall.freq / 1000000; callFreq = Math.round(freq * 1000) / 1000; } srcList = currentCall.srcList.map((source, index) => {source.src}[{source.pos}]); callLength = currentCall.len; talkgroupNum = currentCall.talkgroupNum; callDownload = currentCall.url; callTweet = "https://twitter.com/intent/tweet?url=" + encodeURIComponent(document.location.origin + props.link) + "&via=" + encodeURIComponent("OpenMHz"); } const [activeTab, setActiveTab] = useState(0); const handleTabChange = (e, data) => setActiveTab(data.activeIndex); const panes = [ { menuItem: 'Call Info', render: () => { return (
{srcList} Seconds {callLength} Talkgroup {talkgroupNum} {callTime} {callDate} {callFreq} MHz Tweet Download Link
) } }, { menuItem: 'Playlist', render: () => { return ( ) } } ] return (
); } export default CallInfo;