|
|
|
@ -28,24 +28,25 @@ export const LanguageSelector: FunctionComponent<
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const ProfileSelector: FunctionComponent<BaseInput<Language.Profile>> =
|
|
|
|
|
({ settingKey }) => {
|
|
|
|
|
const profiles = useLatestProfiles();
|
|
|
|
|
export const ProfileSelector: FunctionComponent<
|
|
|
|
|
BaseInput<Language.Profile>
|
|
|
|
|
> = ({ settingKey }) => {
|
|
|
|
|
const profiles = useLatestProfiles();
|
|
|
|
|
|
|
|
|
|
const profileOptions = useMemo<SelectorOption<number>[]>(
|
|
|
|
|
() =>
|
|
|
|
|
profiles.map((v) => {
|
|
|
|
|
return { label: v.name, value: v.profileId };
|
|
|
|
|
}),
|
|
|
|
|
[profiles]
|
|
|
|
|
);
|
|
|
|
|
const profileOptions = useMemo<SelectorOption<number>[]>(
|
|
|
|
|
() =>
|
|
|
|
|
profiles.map((v) => {
|
|
|
|
|
return { label: v.name, value: v.profileId };
|
|
|
|
|
}),
|
|
|
|
|
[profiles]
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Selector
|
|
|
|
|
clearable
|
|
|
|
|
options={profileOptions}
|
|
|
|
|
settingKey={settingKey}
|
|
|
|
|
beforeStaged={(v) => (v === null ? "" : v)}
|
|
|
|
|
></Selector>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
return (
|
|
|
|
|
<Selector
|
|
|
|
|
clearable
|
|
|
|
|
options={profileOptions}
|
|
|
|
|
settingKey={settingKey}
|
|
|
|
|
beforeStaged={(v) => (v === null ? "" : v)}
|
|
|
|
|
></Selector>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|