Track HiveGrid Cloud planning reference
This commit is contained in:
1 parent
b3d5ea6764
commit
e341c5938a
5784 files changed
+1104929
-3
No files matched your search
@@ -0,0 +1,44 @@
|
||||
import { Fragment, ReactNode } from "react";
|
||||
import { Popover, Transition } from "@headlessui/react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import ShareIcon from "../icons/ShareIcon";
|
||||
import { Button } from "../button";
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
disabled?: boolean;
|
||||
children: ReactNode;
|
||||
}
|
||||
export default function ButtonFlyout({ className, disabled, children }: Props) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Popover className="relative">
|
||||
{({ open }) => (
|
||||
<>
|
||||
<Popover.Button as={Button} type="button" variant="outline" disabled={disabled} className={className}>
|
||||
<span className="inline-flex items-center space-x-2">
|
||||
<span>{t("shared.share")}</span>
|
||||
<ShareIcon className={open ? "h-4 w-4 text-foreground/80" : "h-4 w-4 text-muted-foreground"} />
|
||||
</span>
|
||||
</Popover.Button>
|
||||
|
||||
<Transition
|
||||
as={Fragment}
|
||||
enter="transition ease-out duration-200"
|
||||
enterFrom="opacity-0 translate-y-1"
|
||||
enterTo="opacity-100 translate-y-0"
|
||||
leave="transition ease-in duration-150"
|
||||
leaveFrom="opacity-100 translate-y-0"
|
||||
leaveTo="opacity-0 translate-y-1"
|
||||
>
|
||||
<Popover.Panel className="absolute left-1/2 z-10 mt-3 w-screen max-w-xs -translate-x-1/2 transform px-2 sm:px-0">
|
||||
<div className="overflow-hidden rounded-lg shadow-lg ring-1 ring-black ring-opacity-5">
|
||||
<div className="bg-background relative grid gap-6 px-5 py-6 sm:gap-8 sm:p-8">{children}</div>
|
||||
</div>
|
||||
</Popover.Panel>
|
||||
</Transition>
|
||||
</>
|
||||
)}
|
||||
</Popover>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user