2021-05-21 14:37:30 +00:00
|
|
|
import React, { useContext } from "react"
|
2021-05-20 10:16:01 +00:00
|
|
|
import { faChartBar, faCloud, faMap, faStar } from "@fortawesome/free-solid-svg-icons"
|
2021-05-21 14:37:30 +00:00
|
|
|
import ContextRepositoryViewer from "../../contexts/ContextRepositoryViewer"
|
|
|
|
import ButtonPicker from "./ButtonPicker"
|
2021-05-19 00:05:20 +00:00
|
|
|
|
|
|
|
|
2021-05-23 03:03:41 +00:00
|
|
|
/**
|
|
|
|
* Tab selector for the Visualization box of a RepositoryViewer.
|
|
|
|
*
|
|
|
|
* @param props - Additional props to pass to the div.
|
|
|
|
* @returns {JSX.Element}
|
|
|
|
* @constructor
|
|
|
|
*/
|
2021-05-21 17:52:56 +00:00
|
|
|
export default function PickerVisualization({ ...props }) {
|
|
|
|
const { visualizationTab, setVisualizationTab } = useContext(ContextRepositoryViewer)
|
2021-05-21 14:37:30 +00:00
|
|
|
|
2021-05-19 00:05:20 +00:00
|
|
|
return (
|
|
|
|
<div {...props}>
|
2021-05-21 14:37:30 +00:00
|
|
|
<ButtonPicker
|
|
|
|
currentTab={visualizationTab}
|
|
|
|
setTab={setVisualizationTab}
|
|
|
|
name={"stats"}
|
|
|
|
icon={faStar}
|
|
|
|
/>
|
|
|
|
<ButtonPicker
|
|
|
|
currentTab={visualizationTab}
|
|
|
|
setTab={setVisualizationTab}
|
|
|
|
name={"wordcloud"}
|
|
|
|
icon={faCloud}
|
2021-05-20 11:36:07 +00:00
|
|
|
/>
|
2021-05-21 14:37:30 +00:00
|
|
|
<ButtonPicker
|
|
|
|
currentTab={visualizationTab}
|
|
|
|
setTab={setVisualizationTab}
|
|
|
|
name={"chart"}
|
|
|
|
icon={faChartBar}
|
2021-05-20 10:16:01 +00:00
|
|
|
/>
|
2021-05-21 14:37:30 +00:00
|
|
|
<ButtonPicker
|
|
|
|
currentTab={visualizationTab}
|
|
|
|
setTab={setVisualizationTab}
|
|
|
|
name={"map"}
|
|
|
|
icon={faMap}
|
2021-05-20 10:16:01 +00:00
|
|
|
/>
|
2021-05-19 00:05:20 +00:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|