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

46 lines
1.4 KiB
JavaScript
Raw Normal View History

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
*/
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>
)
}