diff --git a/src/components/Dropdown/index.tsx b/src/components/Dropdown/index.tsx index c252220b..98e90612 100644 --- a/src/components/Dropdown/index.tsx +++ b/src/components/Dropdown/index.tsx @@ -1,24 +1,24 @@ import { Select } from "antd"; +import { map } from "lodash-es"; import { Dictionary, PackingInputs } from "../../types"; interface DropdownProps { placeholder: string; + defaultValue?: string; options: Dictionary; onChange: (value: string) => void; } const Dropdown = (props: DropdownProps): JSX.Element => { - const { placeholder, options, onChange } = props; - const selectOptions = Object.entries(options).map(([key]) => ( - { - label: {key}, - value: key, - } - )); + const { placeholder, options, onChange, defaultValue } = props; + const selectOptions = map(options, (opt, key) => ({ + label: opt.name || key, + value: opt.recipe, + })); return (