import { useIsDarkTheme } from '@/components/theme-provider'; import { cn } from '@/lib/utils'; import { parseColorToRGB } from '@/utils/common-util'; import React from 'react'; interface SpotlightProps { className?: string; opcity?: number; coverage?: number; X?: string; Y?: string; color?: string; } /** * * @param opcity 0~1 default 0.5 * @param coverage 0~100 default 60 * @returns */ const Spotlight: React.FC = ({ className, opcity = 0.5, coverage = 60, X = '50%', Y = '190%', color, }) => { const isDark = useIsDarkTheme(); let realColor: [number, number, number] | undefined = undefined; if (color) { realColor = parseColorToRGB(color); } const rgb = realColor ? realColor.join(',') : isDark ? '255, 255, 255' : '194, 221, 243'; return (
); }; export default Spotlight;