Something went wrong. Try again.
Your thinking partner.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384import Svg, { Circle, Path, Rect } from "react-native-svg";import { useTheme } from "../../theme/ThemeProvider";
export type IconName = | "history" | "settings" | "back" | "arrow" | "plus" | "photo" | "camera" | "file" | "minus" | "queue" | "search" | "chevron" | "sun" | "moon" | "system" | "cloud" | "server";const paths: Record<Exclude<IconName, "sun" | "system" | "server">, string> = { history: "M4 7h16M4 12h12M4 17h8", settings: "M4 7h16M4 17h16M8 4v6M16 14v6", back: "m14 5-7 7 7 7", arrow: "M12 19V5m-6 6 6-6 6 6", plus: "M12 5v14M5 12h14", photo: "M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2ZM3 17l6-6 4 4 3-3 5 5M10 7a2 2 0 1 1-4 0 2 2 0 0 1 4 0", camera: "M8 5l2-2h4l2 2h3a2 2 0 0 1 2 2v12H3V7a2 2 0 0 1 2-2ZM16 12a4 4 0 1 1-8 0 4 4 0 0 1 8 0", file: "M14 3H5v18h14V8l-5-5Zm0 0v6h5", minus: "M5 12h14", queue: "M12 3v10m-4-4 4 4 4-4M5 17h14M5 21h14", search: "m16 16 4 4M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0", chevron: "m9 6 6 6-6 6", moon: "M20 14A8.5 8.5 0 0 1 10 4a8.5 8.5 0 1 0 10 10Z", cloud: "M7 18a5 5 0 1 1 .7-9.9A6 6 0 0 1 19 10a4 4 0 0 1 0 8Z",};export function Icon({ name, size = 22, color, strokeWidth = 1.6,}: { name: IconName; size?: number; color?: string; strokeWidth?: number;}) { const { colors } = useTheme(); return ( <Svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color ?? colors.ink2} strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round" aria-hidden={true} > {name === "sun" ? ( <> <Circle cx="12" cy="12" r="4" /> <Path d="M12 2v2m0 16v2M2 12h2m16 0h2M5 5l1.5 1.5m11 11L19 19M5 19l1.5-1.5m11-11L19 5" /> </> ) : name === "system" ? ( <> <Rect x="3" y="4" width="18" height="13" rx="2" /> <Path d="M8 21h8m-4-4v4" /> </> ) : name === "server" ? ( <> <Rect x="4" y="3" width="16" height="7" rx="2" /> <Rect x="4" y="14" width="16" height="7" rx="2" /> <Path d="M8 6.5h.01M8 17.5h.01" /> </> ) : ( <Path d={paths[name]} /> )} </Svg> );}