Migrate to a monorepo structure (#2909)
This commit is contained in:
@ -0,0 +1,12 @@
|
||||
import { Fields } from '@/spreadsheet-import/types';
|
||||
|
||||
export const getFieldOptions = <T extends string>(
|
||||
fields: Fields<T>,
|
||||
fieldKey: string,
|
||||
) => {
|
||||
const field = fields.find(({ key }) => fieldKey === key);
|
||||
if (!field) {
|
||||
return [];
|
||||
}
|
||||
return field.fieldType.type === 'select' ? field.fieldType.options : [];
|
||||
};
|
||||
Reference in New Issue
Block a user