import React, { useState } from 'react'; import { Droplets } from 'lucide-react'; import { useI18n } from '../application/i18n/I18nProvider'; import { cn } from '../lib/utils'; import { Button } from './ui/button'; import { Popover, PopoverContent, PopoverTrigger } from './ui/popover'; import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip'; const OPACITY_PRESETS = [ { label: '100%', value: 1 }, { label: '85%', value: 0.85 }, { label: '70%', value: 0.7 }, ] as const; interface WindowOpacityButtonProps { windowOpacity: number; setWindowOpacity: (opacity: number) => void; className?: string; style?: React.CSSProperties; } export const WindowOpacityButton: React.FC = ({ windowOpacity, setWindowOpacity, className, style, }) => { const { t } = useI18n(); const [isOpen, setIsOpen] = useState(false); const percent = Math.round(windowOpacity * 100); return ( {t('topTabs.windowOpacity')} e.preventDefault()} >
{t('topTabs.windowOpacity')}
setWindowOpacity(Number(e.target.value) / 100)} className="flex-1 accent-primary" /> {percent}%
{OPACITY_PRESETS.map((preset) => ( ))}
); }; export default WindowOpacityButton;