forked from sqlchat/sqlchat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDropdown.tsx
More file actions
28 lines (23 loc) · 685 Bytes
/
Dropdown.tsx
File metadata and controls
28 lines (23 loc) · 685 Bytes
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
import * as DropdownUI from "@radix-ui/react-dropdown-menu";
import { ReactNode } from "react";
interface Props {
children: ReactNode;
tigger: ReactNode;
}
const Dropdown = (props: Props) => {
const { children, tigger } = props;
return (
<DropdownUI.Root modal={false}>
<DropdownUI.Trigger asChild onClick={(e) => e.stopPropagation()}>
{tigger}
</DropdownUI.Trigger>
<DropdownUI.Portal>
<DropdownUI.Content className="z-[999] drop-shadow" sideOffset={5}>
{children}
</DropdownUI.Content>
</DropdownUI.Portal>
</DropdownUI.Root>
);
};
export const DropdownItem = DropdownUI.Item;
export default Dropdown;