Download spectrum/src/components/settingsViews/subnav.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 789 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/src/components/settingsViews/subnav.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/src/components/settingsViews/subnav.js
-
curl -L -o subnav.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/src/components/settingsViews/subnav.js
789 Bytes
| // @flow | |
| import * as React from 'react'; | |
| import { Link } from 'react-router-dom'; | |
| import { StyledSubnav, SubnavList, SubnavListItem } from './style'; | |
| type SubnavItem = { | |
| to: string, | |
| label: string, | |
| activeLabel: string, | |
| }; | |
| type Props = { | |
| items: Array<SubnavItem>, | |
| activeTab: string, | |
| }; | |
| class Subnav extends React.Component<Props> { | |
| render() { | |
| const { activeTab, items } = this.props; | |
| return ( | |
| <StyledSubnav> | |
| <SubnavList> | |
| {items.map((item, i) => { | |
| return ( | |
| <SubnavListItem key={i} active={activeTab === item.activeLabel}> | |
| <Link to={item.to}>{item.label}</Link> | |
| </SubnavListItem> | |
| ); | |
| })} | |
| </SubnavList> | |
| </StyledSubnav> | |
| ); | |
| } | |
| } | |
| export default Subnav; | |