import { Dropdown, Field } from 'decky-frontend-lib'; import { FunctionComponent } from 'react'; import { useSetting } from '../../../../utils/hooks/useSetting'; enum UpdateBranch { Stable, Prerelease, Nightly, } const BranchSelect: FunctionComponent<{}> = () => { const [selectedBranch, setSelectedBranch] = useSetting('branch', UpdateBranch.Prerelease); return ( typeof branch == 'string') .map((branch) => ({ label: branch, data: UpdateBranch[branch], }))} selectedOption={selectedBranch} onChange={(newVal) => { setSelectedBranch(newVal.data); }} /> ); }; export default BranchSelect;