mirror of
https://github.com/zoriya/v10.git
synced 2026-08-10 08:08:10 +00:00
24 lines
797 B
JavaScript
24 lines
797 B
JavaScript
"use client";
|
|
import { renderElement } from "../../utils/use-render.js";
|
|
import { useTooltipContext } from "./context.js";
|
|
import { forwardRef } from "react";
|
|
//#region src/ui/tooltip/tooltip-label.tsx
|
|
/** Tooltip body label; defaults to context `content.label` from the linked trigger. */
|
|
const TooltipLabel = forwardRef(function TooltipLabel({ render, className, style, children, ...elementProps }, forwardedRef) {
|
|
const { state, stateAttrMap, content } = useTooltipContext();
|
|
const body = children !== void 0 ? children : content?.label ?? "";
|
|
return renderElement("span", {
|
|
render,
|
|
className,
|
|
style
|
|
}, {
|
|
state,
|
|
stateAttrMap,
|
|
ref: forwardedRef,
|
|
props: [elementProps, { children: body }]
|
|
});
|
|
});
|
|
//#endregion
|
|
export { TooltipLabel };
|
|
|
|
//# sourceMappingURL=tooltip-label.js.map
|