"use client" import { cn } from "@/lib/utils" interface GpuSwitchModeIndicatorProps { mode: "lxc" | "vm" | "unknown" isEditing?: boolean pendingMode?: "lxc" | "vm" | null onToggle?: (e: React.MouseEvent) => void className?: string } export function GpuSwitchModeIndicator({ mode, isEditing = false, pendingMode = null, onToggle, className, }: GpuSwitchModeIndicatorProps) { const displayMode = pendingMode ?? mode const isLxcActive = displayMode === "lxc" const isVmActive = displayMode === "vm" const hasChanged = pendingMode !== null && pendingMode !== mode // Colors const activeColor = isLxcActive ? "#3b82f6" : isVmActive ? "#a855f7" : "#6b7280" const inactiveColor = "#374151" // gray-700 for dark theme const lxcColor = isLxcActive ? "#3b82f6" : inactiveColor const vmColor = isVmActive ? "#a855f7" : inactiveColor const handleClick = (e: React.MouseEvent) => { // Only stop propagation and handle toggle when in editing mode if (isEditing) { e.stopPropagation() if (onToggle) { onToggle(e) } } // When not editing, let the click propagate to the card to open the modal } return (