File size: 789 Bytes
0e11366
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// components/ReportIcon.tsx
import * as Lucide from "lucide-react";

const pascal = (s: string) =>
  s.replace(/(^\w|-\w)/g, (m) => m.replace("-", "").toUpperCase());

export function ReportIcon({
  name = "info",
  size = 32,
}: {
  name?: string;
  size?: number;
}) {
  const key = (name || "info").toLowerCase();

  // 3D local PNGs: name like "3d:police-light"
  if (key.startsWith("3d-")) {
    const file = key; // "police-light"
    return (
      <img
        src={`/icons/3d/${file}.png`}
        alt={file}
        width={size}
        height={size}
        loading="lazy"
        style={{ display: "block" }}
      />
    );
  }

  // fallback to your existing Lucide logic
  const Comp = (Lucide as any)[pascal(key)] ?? (Lucide as any).Info;
  return <Comp size={size} />;
}