You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
914 B
TypeScript
38 lines
914 B
TypeScript
// frontend/components/Icon.tsx
|
|
import { PATHS, type IconName } from "./icons/paths";
|
|
|
|
export function Icon({
|
|
name,
|
|
w = 1.9, // 원본 strokeWidth 기본 1.9 (shell.jsx 45행)
|
|
className = "ic",
|
|
}: {
|
|
name: IconName;
|
|
w?: number;
|
|
className?: string;
|
|
}) {
|
|
const d = PATHS[name];
|
|
if (!d) {
|
|
// 누락 가드: 콘솔 경고 + 빈 SVG(레이아웃 보존). 프로덕션 렌더 깨짐 방지.
|
|
if (process.env.NODE_ENV !== "production") {
|
|
console.warn(`[Icon] unknown icon name: "${name}"`);
|
|
}
|
|
return <svg className={className} viewBox="0 0 24 24" aria-hidden />;
|
|
}
|
|
return (
|
|
<svg
|
|
className={className}
|
|
viewBox="0 0 24 24"
|
|
fill="none"
|
|
stroke="currentColor"
|
|
strokeWidth={w}
|
|
strokeLinecap="round"
|
|
strokeLinejoin="round"
|
|
aria-hidden
|
|
>
|
|
{d.split("|").map((s, i) => (
|
|
<path key={i} d={s} />
|
|
))}
|
|
</svg>
|
|
);
|
|
}
|