e5f41731ae
* bootstrap next app + add overview page * fix AssetList type * fix up nav stuff * Refactor Nav component and add network components pages * Refactor WorldMap component and update TelegramIcon, GitHubIcon, NymVpnIcon, DiscordIcon, and TwitterIcon components * add service providers page * mixnodes page * delegations page + use material react table for all tables * nodes map page * Refactor StyledLink component and remove unnecessary console.log statements * Refactor ESLint configuration, remove unused dependencies, and update component imports * update deps * Refactor imports and update dependencies * fix dark mode * build single mixnode page * build single gateway page * Refactor handleOnDelegate function to use useCallback in mixnodes page.tsx * Add defaults for constants --------- Co-authored-by: Mark Sinclair <mmsinclair@users.noreply.github.com>
52 lines
1.4 KiB
TypeScript
52 lines
1.4 KiB
TypeScript
import React from 'react'
|
|
import { FormControl, MenuItem, Select } from '@mui/material'
|
|
import { useIsMobile } from '@/app/hooks/useIsMobile'
|
|
|
|
export enum VersionSelectOptions {
|
|
latestVersion = 'Latest versions',
|
|
olderVersions = 'Older versions',
|
|
all = 'All',
|
|
}
|
|
export const VersionDisplaySelector = ({
|
|
selected,
|
|
handleChange,
|
|
}: {
|
|
selected: VersionSelectOptions
|
|
handleChange: (option: VersionSelectOptions) => void
|
|
}) => {
|
|
const isMobile = useIsMobile()
|
|
|
|
return (
|
|
<FormControl size="small">
|
|
<Select
|
|
value={selected}
|
|
onChange={(e) => handleChange(e.target.value as VersionSelectOptions)}
|
|
labelId="simple-select-label"
|
|
id="simple-select"
|
|
sx={{
|
|
marginRight: isMobile ? 0 : 2,
|
|
}}
|
|
>
|
|
<MenuItem
|
|
value={VersionSelectOptions.latestVersion}
|
|
data-testid="show-gateway-latest-version"
|
|
>
|
|
{VersionSelectOptions.latestVersion}
|
|
</MenuItem>
|
|
<MenuItem
|
|
value={VersionSelectOptions.olderVersions}
|
|
data-testid="show-gateway-old-versions"
|
|
>
|
|
{VersionSelectOptions.olderVersions}
|
|
</MenuItem>
|
|
<MenuItem
|
|
value={VersionSelectOptions.all}
|
|
data-testid="show-gateway-all-versions"
|
|
>
|
|
{VersionSelectOptions.all}
|
|
</MenuItem>
|
|
</Select>
|
|
</FormControl>
|
|
)
|
|
}
|