mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-21 08:11:24 +02:00
Custom HTTP method names
This commit is contained in:
@@ -16,18 +16,20 @@ export interface RadioDropdownProps<T = string | null> {
|
||||
value: T;
|
||||
onChange: (value: T) => void;
|
||||
items: RadioDropdownItem<T>[];
|
||||
extraItems?: DropdownProps['items'];
|
||||
children: DropdownProps['children'];
|
||||
}
|
||||
|
||||
export function RadioDropdown<T = string | null>({
|
||||
value,
|
||||
items,
|
||||
extraItems,
|
||||
onChange,
|
||||
children,
|
||||
}: RadioDropdownProps<T>) {
|
||||
const dropdownItems = useMemo(
|
||||
() =>
|
||||
items.map((item) => {
|
||||
() => [
|
||||
...items.map((item) => {
|
||||
if (item.type === 'separator') {
|
||||
return item;
|
||||
} else {
|
||||
@@ -40,7 +42,9 @@ export function RadioDropdown<T = string | null>({
|
||||
};
|
||||
}
|
||||
}),
|
||||
[items, value, onChange],
|
||||
...(extraItems ?? []),
|
||||
],
|
||||
[items, extraItems, value, onChange],
|
||||
);
|
||||
|
||||
return <Dropdown items={dropdownItems}>{children}</Dropdown>;
|
||||
|
||||
Reference in New Issue
Block a user