fix: highlight menu dropdown server options

This commit is contained in:
Faisal Amir 2024-01-29 11:57:56 +07:00
parent 3445a25606
commit 50c499601e

View File

@ -73,6 +73,8 @@ const LocalServerScreen = () => {
const [host, setHost] = useAtom(hostAtom)
const [port, setPort] = useAtom(portAtom)
const hostOptions = ['127.0.0.1', '0.0.0.0']
const FIRST_TIME_VISIT_API_SERVER = 'firstTimeVisitAPIServer'
const [firstTimeVisitAPIServer, setFirstTimeVisitAPIServer] =
@ -166,8 +168,19 @@ const LocalServerScreen = () => {
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="127.0.0.1">127.0.0.1</SelectItem>
<SelectItem value="0.0.0.0">0.0.0.0</SelectItem>
{hostOptions.map((option, i) => {
return (
<SelectItem
key={i}
value={option}
className={twMerge(
host === option && 'bg-secondary'
)}
>
{option}
</SelectItem>
)
})}
</SelectContent>
</Select>