import { FC } from "react"; import { View, ViewStyle } from "react-native"; import { IconBackground } from "./IconBackground"; interface WifiIconProps { size?: number; color?: string; glowColor?: string; strength?: 0 | 1 | 2 | 3 | 4; colorPreset?: "cyan" | "green" | "purple" | "pink" | "yellow" | "orange"; variant?: "circuit" | "matrix" | "glitch" | "nodes" | "grid"; noBackground?: boolean; showSlash?: boolean; } const ColorPresets = { cyan: { color: "#00D4FF", glow: "#00D4FF" }, green: { color: "#00FF88", glow: "#00FF88" }, purple: { color: "#9945FF", glow: "#9945FF" }, pink: { color: "#FF45FF", glow: "#FF45FF" }, yellow: { color: "#FFD700", glow: "#FFD700" }, orange: { color: "#FF8800", glow: "#FF8800" }, }; // Arc configurations - matching original spacing const ARCS = [ { strength: 1, size: 15, topOffset: 0.55, opacity: 0.9 }, { strength: 2, size: 30, topOffset: 0.45, opacity: 0.8 }, { strength: 3, size: 45, topOffset: 0.35, opacity: 0.7 }, { strength: 4, size: 60, topOffset: 0.25, opacity: 0.6 }, ]; // Simplified dots const DOTS = [ { x: 0.35, y: 0.5, minStrength: 2 }, { x: 0.65, y: 0.5, minStrength: 2 }, { x: 0.5, y: 0.3, minStrength: 4 }, ]; export const WifiCircuitIcon: FC = ({ size = 24, color, glowColor, strength = 4, colorPreset = "cyan", variant = "nodes", noBackground = true, showSlash = false, }) => { const scale = size / 60; const strokeWidth = 2.5 * scale; const isOff = strength === 0; const preset = ColorPresets[colorPreset as keyof typeof ColorPresets] || ColorPresets.cyan; const baseColor = color || preset.color; const baseGlow = glowColor || preset.glow; const activeColor = isOff ? "#333" : baseColor; const activeGlow = isOff ? "#333" : baseGlow; const iconContent = ( <> {/* Central dot */} 0 ? 1 : 0.3, } as ViewStyle } /> {/* WiFi arcs - loop based on strength */} {ARCS.filter((arc) => strength >= arc.strength).map((arc, i) => ( ))} {/* Simplified data dots */} {strength > 0 && DOTS.filter((dot) => strength >= dot.minStrength).map((dot, i) => ( ))} {/* Simplified slash overlay */} {showSlash && ( )} ); if (noBackground) { return ( {iconContent} ); } return ( {iconContent} ); }; export const WifiIcon = WifiCircuitIcon;