import React, { useMemo } from 'react'; import type * as CSS from 'csstype'; export interface PointerProps extends React.HTMLAttributes { prefixCls?: string; top?: CSS.Properties['top']; left: CSS.Properties['left']; color?: string; } export const Pointer = ({ className, color, left, top, prefixCls }: PointerProps): JSX.Element => { const style: CSS.Properties = { position: 'absolute', top, left, }; const stylePointer: CSS.Properties = { '--saturation-pointer-box-shadow': 'rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px', width: 6, height: 6, transform: 'translate(-3px, -3px)', boxShadow: 'var(--saturation-pointer-box-shadow)', borderRadius: '50%', backgroundColor: color, } as CSS.Properties; return useMemo( () => (
), [top, left, color, className, prefixCls], ); };