mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-23 10:26:40 +00:00
* fix: remove the space and fix the classname * refactor: made the dynamicColumnsTable-items responsive * fix: setcolumndata to a separate function * fix: handle invalid CreatedOrUpdateTime * fix: hyphenate classname and bme * refactor: move the implementation to separate component * refactor: removed the bydefault render * refactor: remove render * refactor: removed unwanted imports * fix: remove the space and fix the classname * refactor: made the dynamicColumnsTable-items responsive * fix: setcolumndata to a separate function * fix: handle invalid CreatedOrUpdateTime * fix: hyphenate classname and bme * refactor: move the implementation to separate component * refactor: removed the bydefault render * refactor: remove render * fix: the classname
31 lines
733 B
TypeScript
31 lines
733 B
TypeScript
import './DropDown.styles.scss';
|
|
|
|
import { EllipsisOutlined } from '@ant-design/icons';
|
|
import { Button, Dropdown, MenuProps } from 'antd';
|
|
import { useIsDarkMode } from 'hooks/useDarkMode';
|
|
|
|
function DropDown({ element }: { element: JSX.Element[] }): JSX.Element {
|
|
const isDarkMode = useIsDarkMode();
|
|
|
|
const items: MenuProps['items'] = element.map(
|
|
(e: JSX.Element, index: number) => ({
|
|
label: e,
|
|
key: index,
|
|
}),
|
|
);
|
|
|
|
return (
|
|
<Dropdown menu={{ items }}>
|
|
<Button
|
|
type="link"
|
|
className={!isDarkMode ? 'dropdown-button--dark' : 'dropdown-button'}
|
|
onClick={(e): void => e.preventDefault()}
|
|
>
|
|
<EllipsisOutlined className="dropdown-icon" />
|
|
</Button>
|
|
</Dropdown>
|
|
);
|
|
}
|
|
|
|
export default DropDown;
|