PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / trunk
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance vtrunk
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
wp-optimize / vendor / team-updraft / lib-onboarding-wizard / Wizard / Onboarding / src / components / Fields / Label.tsx

Label.tsx in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance trunk, at vendor/team-updraft/lib-onboarding-wizard/Wizard/Onboarding/src/components/Fields/Label.tsx

41 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import * as RadixLabel from "@radix-ui/react-label";
2 import { memo, type ReactNode } from "react";
3 import { clsx } from "clsx";
4 import Icon from "../../utils/Icon";
5 import Tooltip from "../../utils/Tooltip/Tooltip";
6 import type { TooltipProps } from "../../utils/Tooltip/Tooltip";
7
8 interface LabelProps {
9 htmlFor?: string;
10 text: ReactNode;
11 tooltip?: TooltipProps;
12 className?: string;
13 }
14
15 const Label = ({
16 htmlFor,
17 text,
18 tooltip,
19 className,
20 }: LabelProps) => {
21 return (
22 <RadixLabel.Root
23 htmlFor={htmlFor}
24 className={clsx("flex items-center gap-2 text-md font-medium text-black cursor-pointer", className)}
25 >
26 <span>{text}</span>
27 {tooltip && (
28 <Tooltip tooltip={tooltip} triggerClassName="ml-[-4px]">
29 <Icon
30 name={'info'}
31 color="gray500"
32 fill="gray500"
33 size={16}
34 />
35 </Tooltip>
36 )}
37 </RadixLabel.Root>
38 );
39 };
40
41 export default memo(Label);