MCPcopy Create free account
hub / github.com/Packstack-Tech/packstack / categoryOptions

Function categoryOptions

frontend/src/lib/utils/form.tsx:4–4  ·  view source on GitHub ↗
(categories: Category[])

Source from the content-addressed store, hash-verified

2import { DurationUnit, Gender, WeightUnit, getGenderName } from "enums";
3
4export const categoryOptions = (categories: Category[]) => categories.map(cat => ({ value: cat.id, label: cat.name }));
5export const weightUnitOptions = () => Object.values(WeightUnit).map(unit => ({ value: unit, label: unit }));
6export const durationUnitOptions = () => Object.values(DurationUnit).map(unit => ({ value: unit, label: unit }));
7export const genderOptions = () => Object.values(Gender).map(unit => ({ value: unit, label: getGenderName(unit) }));

Callers 3

EditFormFunction · 0.90
ItemFormFunction · 0.90
ItemFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected