mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### What? We can use codspeed for profiling the build performance, considering that these apps are very small. ### Why? We need an e2e benchmark.
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
'use client'
|
|
import * as React from 'react'
|
|
import Box from '@mui/material/Box'
|
|
import FormControl from '@mui/material/FormControl'
|
|
import InputLabel from '@mui/material/InputLabel'
|
|
import MenuItem from '@mui/material/MenuItem'
|
|
import Select from '@mui/material/Select'
|
|
import { useColorScheme } from '@mui/material/styles'
|
|
|
|
export default function ModeSwitch() {
|
|
const { mode, setMode } = useColorScheme()
|
|
if (!mode) {
|
|
return null
|
|
}
|
|
return (
|
|
<Box
|
|
sx={{
|
|
display: 'flex',
|
|
justifyContent: 'flex-end',
|
|
mt: 1,
|
|
p: 1,
|
|
}}
|
|
>
|
|
<FormControl>
|
|
<InputLabel id="mode-select-label">Theme</InputLabel>
|
|
<Select
|
|
labelId="mode-select-label"
|
|
id="mode-select"
|
|
value={mode}
|
|
onChange={(event) => setMode(event.target.value as typeof mode)}
|
|
label="Theme"
|
|
>
|
|
<MenuItem value="system">System</MenuItem>
|
|
<MenuItem value="light">Light</MenuItem>
|
|
<MenuItem value="dark">Dark</MenuItem>
|
|
</Select>
|
|
</FormControl>
|
|
</Box>
|
|
)
|
|
}
|