Something went wrong. Try again.
Starship Simulator Controls thoriumsim.com
Something went wrong. Try again.
948 B · 34 lines
TSX
at develop
1234567891011121314151617181920212223242526272829303132333435import { popoverTransitionClasses } from "@thorium/ui/Dropdown";import { cn } from "@thorium/utils/cn";import type { ReactNode } from "react";import { Button, Dialog, DialogTrigger, Popover } from "react-aria-components";
import { Icon } from "./Icon";
const InfoTip = ({ children, className, dialogClassName,}: { children: ReactNode; className?: string; dialogClassName?: string;}) => { if (!children) return null; return ( <DialogTrigger> <Button className={cn("btn btn-ghost btn-xs p-0 px-0! min-h-4! h-4! w-4", className)} aria-label="More Info" > <Icon name="info" className="text-primary inline-block cursor-pointer text-base" /> </Button> <Popover className={cn("theme-container", popoverTransitionClasses)}> <Dialog className={cn("max-w-xs w-max panel bg-black/90! text-white p-2", dialogClassName)}> {children} </Dialog> </Popover> </DialogTrigger> );};export default InfoTip;