mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-23 10:26:40 +00:00
30 lines
666 B
TypeScript
30 lines
666 B
TypeScript
|
|
import './DropDown.styles.scss';
|
||
|
|
|
||
|
|
import { EllipsisOutlined } from '@ant-design/icons';
|
||
|
|
import { Button, Dropdown, MenuProps, Space } from 'antd';
|
||
|
|
|
||
|
|
function DropDown({ element }: { element: JSX.Element[] }): JSX.Element {
|
||
|
|
const items: MenuProps['items'] = element.map(
|
||
|
|
(e: JSX.Element, index: number) => ({
|
||
|
|
label: e,
|
||
|
|
key: index,
|
||
|
|
}),
|
||
|
|
);
|
||
|
|
|
||
|
|
return (
|
||
|
|
<Dropdown menu={{ items }} className="Dropdown-container">
|
||
|
|
<Button
|
||
|
|
type="link"
|
||
|
|
className="Dropdown-button"
|
||
|
|
onClick={(e): void => e.preventDefault()}
|
||
|
|
>
|
||
|
|
<Space>
|
||
|
|
<EllipsisOutlined className="Dropdown-icon" />
|
||
|
|
</Space>
|
||
|
|
</Button>
|
||
|
|
</Dropdown>
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
export default DropDown;
|