This commit is contained in:
Luke Berndt
2023-01-18 21:50:14 -05:00
parent ca692863fa
commit 5025d37c3c
4 changed files with 68 additions and 47 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -129,8 +129,6 @@ function CallPlayer(props) {
}, [selectCallId, callsData]) }, [selectCallId, callsData])
return ( return (
<div ref={positionRef}> <div ref={positionRef}>
<Container className="main" > <Container className="main" >

View File

@@ -1,4 +1,4 @@
import React from "react"; import React, { useState } from "react";
import { useCallLink } from "./CallLinks"; import { useCallLink } from "./CallLinks";
import { useGetGroupsQuery, useGetTalkgroupsQuery } from '../../features/api/apiSlice' import { useGetGroupsQuery, useGetTalkgroupsQuery } from '../../features/api/apiSlice'
import { Link, useLocation, useParams, useNavigate } from 'react-router-dom'; import { Link, useLocation, useParams, useNavigate } from 'react-router-dom';
@@ -9,9 +9,10 @@ import {
Segment, Segment,
Statistic, Statistic,
Icon, Icon,
Menu Menu,
Tab
} from "semantic-ui-react"; } from "semantic-ui-react";
import PlaylistBuilder from "./PlaylistBuilder"
// ---------------------------------------------------- // ----------------------------------------------------
function CallInfo(props) { function CallInfo(props) {
const { shortName } = useParams(); const { shortName } = useParams();
@@ -45,10 +46,15 @@ function CallInfo(props) {
} }
const { callLink, callDownload, callTweet } = useCallLink(props.call) const { callLink, callDownload, callTweet } = useCallLink(props.call)
const [activeTab, setActiveTab] = useState(0);
const handleTabChange = (e, data) => setActiveTab(data.activeIndex);
const panes = [
{
menuItem: 'Call Info', render: () => {
return ( return (
<div> <div>
<Segment padded attached> <Tab.Pane attached='bottom'>
<Header as='h1'>{header}</Header> <Header as='h1'>{header}</Header>
<List bulleted horizontal link> <List bulleted horizontal link>
{srcList} {srcList}
@@ -83,13 +89,30 @@ function CallInfo(props) {
</List.Content> </List.Content>
</List.Item> </List.Item>
</List> </List>
</Segment> </Tab.Pane>
<Menu attached='bottom'> <Menu>
<a href={callTweet}><Menu.Item name="tweet" ><Icon name='twitter' />Tweet</Menu.Item></a> <a href={callTweet}><Menu.Item name="tweet" ><Icon name='twitter' />Tweet</Menu.Item></a>
<a href={callDownload}><Menu.Item name="download"><Icon name="download" />Download</Menu.Item></a> <a href={callDownload}><Menu.Item name="download"><Icon name="download" />Download</Menu.Item></a>
<a href={callLink}><Menu.Item name="link"><Icon name="at" />Link</Menu.Item></a> <a href={callLink}><Menu.Item name="link"><Icon name="at" />Link</Menu.Item></a>
</Menu> </Menu>
</div> </div>
)
}
},
{
menuItem: 'Playlist', render: () => {
return (
<PlaylistBuilder />
)
}
}
]
return (
<div>
<Tab menu={{ attached: 'top' }} panes={panes} defaultActiveIndex={activeTab} onTabChange={handleTabChange} />
</div>
); );
} }