targo-frontend/src/utils/to-qselect-options.ts

6 lines
244 B
TypeScript

export const toQSelectOptions = <T>(values: readonly T[], i18n_domain?: string): { label: string; value: T }[] => {
return values.map(value => ({
label: ((i18n_domain ?? "") + value).toString(),
value: value
}));
};