All files / packages/components/src dropdown.web.tsx

100% Statements 3/3
100% Branches 0/0
100% Functions 2/2
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28                                      88x 1644x     4x        
import type React from "react";
 
import {
	DropdownItem,
	DropdownMenu,
	Dropdown as DropdownRaw,
	DropdownTrigger,
} from "@heroui/dropdown";
 
type ItemProps = React.PropsWithChildren<{
	key: string;
	className?: string;
}>;
 
export type Props = React.PropsWithChildren<{
	items: ItemProps[];
	testID?: string;
}>;
 
export const Dropdown: React.FC<Props> = ({ children, items, testID }) => (
	<DropdownRaw data-testid={testID}>
		<DropdownTrigger>{children}</DropdownTrigger>
		<DropdownMenu items={items}>
			{({ key, ...itemProps }) => <DropdownItem key={key} {...itemProps} />}
		</DropdownMenu>
	</DropdownRaw>
);