import { useState } from 'react'
export function Icon({ name, size = 18, color, strokeWidth = 1.5, style }) {
const paths = {
shield: <>>,
code: <>>,
upload: <>>,
play: ,
download: <>>,
search: <>>,
alert: <>>,
check: <>>,
filter: <>>,
chevron: ,
chevronRight: ,
chevronLeft: ,
file: <>>,
fileCode: <>>,
users: <>>,
chart: <>>,
xCircle: <>>,
external: <>>,
eye: <>>,
sort: <>>,
arrowLeft: <>>,
sparkles: <>>,
x: <>>,
}
return (
)
}
export function Button({ variant = 'primary', size = 'md', icon, iconRight, children, onClick, style, disabled }) {
const [hover, setHover] = useState(false)
const [pressed, setPressed] = useState(false)
const base = {
display: 'inline-flex', alignItems: 'center', gap: 8,
height: size === 'sm' ? 32 : size === 'lg' ? 48 : 40,
padding: size === 'sm' ? '0 12px' : size === 'lg' ? '0 24px' : '0 18px',
borderRadius: 8, fontFamily: 'Inter, sans-serif',
fontSize: size === 'sm' ? 13 : size === 'lg' ? 15 : 14,
fontWeight: 600, cursor: disabled ? 'not-allowed' : 'pointer',
border: '1px solid transparent',
transition: 'all .12s cubic-bezier(0.22,1,0.36,1)',
opacity: disabled ? 0.4 : 1,
transform: pressed ? 'scale(0.98)' : 'scale(1)',
whiteSpace: 'nowrap',
}
const variants = {
primary: {
background: hover ? '#22E0FF' : '#00D4FF', color: '#0A0F1C',
boxShadow: pressed ? 'none' : hover ? '0 0 32px rgba(0,212,255,0.4)' : '0 0 20px rgba(0,212,255,0.2)',
},
secondary: {
background: 'transparent', color: hover ? '#F8FAFC' : '#CBD5E1',
borderColor: hover ? 'rgba(148,163,184,0.30)' : 'rgba(148,163,184,0.12)',
},
ghost: {
background: hover ? 'rgba(148,163,184,0.06)' : 'transparent',
color: hover ? '#F8FAFC' : '#94A3B8', border: 'none',
},
danger: {
background: hover ? 'rgba(239,68,68,0.20)' : 'rgba(239,68,68,0.12)',
color: '#EF4444', borderColor: 'rgba(239,68,68,0.35)',
},
}
return (
)
}
export function Badge({ tone = 'cyan', children, dot = true, size = 'md' }) {
const tones = {
cyan: { bg: 'rgba(0,212,255,0.12)', bd: 'rgba(0,212,255,0.30)', fg: '#00D4FF' },
red: { bg: 'rgba(239,68,68,0.14)', bd: 'rgba(239,68,68,0.35)', fg: '#EF4444' },
amber: { bg: 'rgba(245,158,11,0.14)', bd: 'rgba(245,158,11,0.35)', fg: '#F59E0B' },
green: { bg: 'rgba(16,185,129,0.14)', bd: 'rgba(16,185,129,0.35)', fg: '#10B981' },
slate: { bg: 'rgba(148,163,184,0.10)',bd: 'rgba(148,163,184,0.25)',fg: '#94A3B8' },
}
const t = tones[tone]
return (
{dot && }
{children}
)
}
export function LangBadge({ lang }) {
const colors = { Python: '#3776AB', JavaScript: '#F7DF1E', Java: '#F89820', 'C++': '#00599C', Go: '#00ADD8', Rust: '#CE422B', Ruby: '#CC342D', TypeScript: '#3178C6' }
return (
{lang || 'Unknown'}
)
}
export function Card({ children, style, glow, hoverable, onClick }) {
const [hover, setHover] = useState(false)
return (
setHover(true)} onMouseLeave={() => setHover(false)}
style={{
background: 'rgba(17,24,39,0.6)',
border: `1px solid ${hover && hoverable ? 'rgba(148,163,184,0.24)' : 'rgba(148,163,184,0.12)'}`,
borderRadius: 12, padding: 20,
backdropFilter: 'blur(20px)', WebkitBackdropFilter: 'blur(20px)',
boxShadow: glow
? 'inset 0 1px 0 rgba(255,255,255,0.03), 0 0 24px rgba(0,212,255,0.15)'
: 'inset 0 1px 0 rgba(255,255,255,0.03)',
cursor: onClick ? 'pointer' : 'default',
transition: 'border-color .12s cubic-bezier(0.22,1,0.36,1)',
...style,
}}>
{children}
)
}
export function Input({ icon, placeholder, value, onChange, style, type = 'text' }) {
const [focus, setFocus] = useState(false)
return (
{icon && }
setFocus(true)} onBlur={() => setFocus(false)}
onChange={e => onChange && onChange(e.target.value)}
style={{
flex: 1, background: 'transparent', border: 'none', outline: 'none',
color: '#F8FAFC', fontFamily: 'Inter, sans-serif', fontSize: 14,
}}/>
)
}
export function Label({ children, style }) {
return (
{children}
)
}
export function Spinner({ size = 32 }) {
return (
)
}