1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-25 06:24:19 +00:00
pds-2021-g2-nest/nest_frontend/components/interactive/PickerVisualization.js

45 lines
1.4 KiB
JavaScript

import React, { useContext } from "react"
import { faChartBar, faCloud, faMap, faStar } from "@fortawesome/free-solid-svg-icons"
import ContextRepositoryViewer from "../../contexts/ContextRepositoryViewer"
import ButtonPicker from "./ButtonPicker"
/**
* Tab selector for the Visualization box of a RepositoryViewer.
*
* @param props - Additional props to pass to the div.
* @returns {JSX.Element}
* @constructor
*/
export default function PickerVisualization({ ...props }) {
const { visualizationTab, setVisualizationTab } = useContext(ContextRepositoryViewer)
return (
<div {...props}>
<ButtonPicker
currentTab={visualizationTab}
setTab={setVisualizationTab}
name={"stats"}
icon={faStar}
/>
<ButtonPicker
currentTab={visualizationTab}
setTab={setVisualizationTab}
name={"wordcloud"}
icon={faCloud}
/>
<ButtonPicker
currentTab={visualizationTab}
setTab={setVisualizationTab}
name={"chart"}
icon={faChartBar}
/>
<ButtonPicker
currentTab={visualizationTab}
setTab={setVisualizationTab}
name={"map"}
icon={faMap}
/>
</div>
)
}