mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2025-01-08 09:17:29 +03:00
20 lines
824 B
TypeScript
20 lines
824 B
TypeScript
import { FC, PropsWithChildren } from 'react';
|
|
import { ButtonDropdown, DropdownMenu, DropdownToggle } from 'reactstrap';
|
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
import { faEllipsisV as menuIcon } from '@fortawesome/free-solid-svg-icons';
|
|
import './DropdownBtnMenu.scss';
|
|
|
|
export type DropdownBtnMenuProps = PropsWithChildren<{
|
|
isOpen: boolean;
|
|
toggle: () => void;
|
|
right?: boolean;
|
|
}>;
|
|
|
|
export const DropdownBtnMenu: FC<DropdownBtnMenuProps> = ({ isOpen, toggle, children, right = true }) => (
|
|
<ButtonDropdown toggle={toggle} isOpen={isOpen}>
|
|
<DropdownToggle size="sm" caret outline className="dropdown-btn-menu__dropdown-toggle">
|
|
<FontAwesomeIcon icon={menuIcon} />
|
|
</DropdownToggle>
|
|
<DropdownMenu end={right}>{children}</DropdownMenu>
|
|
</ButtonDropdown>
|
|
);
|