Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/resources/scripts/components/elements/dropdown/DropdownButton.tsx
10262 views
1
import classNames from 'classnames';
2
import styles from '@/components/elements/dropdown/style.module.css';
3
import { ChevronDownIcon } from '@heroicons/react/solid';
4
import { Menu } from '@headlessui/react';
5
import React from 'react';
6
7
interface Props {
8
className?: string;
9
animate?: boolean;
10
children: React.ReactNode;
11
}
12
13
export default ({ className, animate = true, children }: Props) => (
14
<Menu.Button className={classNames(styles.button, className || 'px-4')}>
15
{typeof children === 'string' ? (
16
<>
17
<span className={'mr-2'}>{children}</span>
18
<ChevronDownIcon aria-hidden={'true'} data-animated={animate.toString()} />
19
</>
20
) : (
21
children
22
)}
23
</Menu.Button>
24
);
25
26