import {
  Tooltip as BaseTooltip,
  TooltipContent as BaseTooltipContent,
  TooltipProvider as BaseTooltipProvider,
  TooltipTrigger as BaseTooltipTrigger,
} from '@/shadcn/tooltip';
import * as React from 'react';
import styles from './Tooltip.module.css';

export { TooltipPortal } from '@radix-ui/react-tooltip';

export interface TooltipProps
  extends React.ComponentPropsWithoutRef<typeof BaseTooltip> {
  variant?: string;
}

const Tooltip = React.forwardRef<
  React.ElementRef<typeof BaseTooltip>,
  TooltipProps
>(({ variant, ...props }) => <BaseTooltip {...props} />);

Tooltip.displayName = 'Tooltip';

export interface TooltipTriggerProps
  extends React.ComponentPropsWithoutRef<typeof BaseTooltipTrigger> {
  variant?: string;
}

const TooltipTrigger = React.forwardRef<
  React.ElementRef<typeof BaseTooltipTrigger>,
  TooltipTriggerProps
>(({ variant, ...props }, ref) => <BaseTooltipTrigger ref={ref} {...props} />);

TooltipTrigger.displayName = 'TooltipTrigger';

export interface TooltipContentProps
  extends React.ComponentPropsWithoutRef<typeof BaseTooltipContent> {
  variant?: string;
}

const TooltipContent = React.forwardRef<
  React.ElementRef<typeof BaseTooltipContent>,
  TooltipContentProps
>(({ variant, ...props }, ref) => <BaseTooltipContent ref={ref} {...props} />);

TooltipContent.displayName = 'TooltipContent';

export interface TooltipProviderProps
  extends React.ComponentPropsWithoutRef<typeof BaseTooltipProvider> {
  variant?: string;
}

const TooltipProvider = React.forwardRef<
  React.ElementRef<typeof BaseTooltipProvider>,
  TooltipProviderProps
>(({ ...props }) => <BaseTooltipProvider {...props} />);

TooltipProvider.displayName = 'TooltipProvider';

export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
