1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-23 13:34:19 +00:00
pds-2021-g2-nest/nest_frontend/components/interactive/ButtonPicker.js

25 lines
720 B
JavaScript
Raw Normal View History

2021-05-21 14:37:30 +00:00
import React from "react"
import ButtonIconOnly from "../base/ButtonIconOnly"
2021-05-23 03:03:41 +00:00
/**
* A {@link ButtonIconOnly} to be used to switch between RepositoryViewer tabs.
*
* @param setTab - Function to change tab.
* @param currentTab - Name of the current tab, as a string.
* @param name - Name of the tab this button should switch to, as a string.
* @param props - Additional props to pass to the button.
* @returns {JSX.Element}
* @constructor
*/
2021-05-21 14:37:30 +00:00
export default function ButtonPicker({ setTab, currentTab, name, ...props }) {
return (
<ButtonIconOnly
onClick={() => setTab(name)}
disabled={currentTab === name}
color={"Grey"}
{...props}
/>
)
}