Add dropdown menus to M&E Data Entry view
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { Portal, Select } from '@chakra-ui/react';
|
||||
|
||||
export default function DropDownMenu({ collection, placeholder = "Select...", size = "sm", width = "200px" }) {
|
||||
return (
|
||||
<Select.Root collection={collection} size={size} width={width}>
|
||||
<Select.HiddenSelect />
|
||||
<Select.Control>
|
||||
<Select.Trigger>
|
||||
<Select.ValueText placeholder={placeholder} />
|
||||
</Select.Trigger>
|
||||
<Select.IndicatorGroup>
|
||||
<Select.ClearTrigger />
|
||||
<Select.Indicator />
|
||||
</Select.IndicatorGroup>
|
||||
</Select.Control>
|
||||
<Portal>
|
||||
<Select.Positioner>
|
||||
<Select.Content>
|
||||
{collection.items.map((item) => (
|
||||
<Select.Item key={item.value} item={item}>
|
||||
{item.label}
|
||||
<Select.ItemIndicator />
|
||||
</Select.Item>
|
||||
))}
|
||||
</Select.Content>
|
||||
</Select.Positioner>
|
||||
</Portal>
|
||||
</Select.Root>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user