import Tippy, { TippyProps } from "@tippyjs/react"; import styled from "styled-components"; import { Text } from "preact-i18n"; import { Children } from "../../types/Preact"; type Props = Omit & { children: Children; content: Children; }; export default function Tooltip(props: Props) { const { children, content, ...tippyProps } = props; return ( {/* // @ts-expect-error Type mis-match. */}
{children}
); } const PermissionTooltipBase = styled.div` display: flex; align-items: center; flex-direction: column; span { font-weight: 700; text-transform: uppercase; color: var(--secondary-foreground); font-size: 11px; } code { font-family: var(--monospace-font); } `; export function PermissionTooltip( props: Omit & { permission: string }, ) { const { permission, ...tooltipProps } = props; return ( {permission} } {...tooltipProps} /> ); }