import {
  IconBooks,
  IconRobot,
  IconMap2,
  IconAccessPoint,
  IconLock,
  IconActivityHeartbeat,
  IconBox,
  type IconProps,
} from '@tabler/icons-react'
import type { ComponentType } from 'react'

/** Susieja modulių duomenų ikonų vardus su Tabler komponentais. */
const ICONS: Record<string, ComponentType<IconProps>> = {
  books: IconBooks,
  robot: IconRobot,
  'map-2': IconMap2,
  'access-point': IconAccessPoint,
  lock: IconLock,
  'activity-heartbeat': IconActivityHeartbeat,
}

export function ModuleIcon({ name, ...props }: { name: string } & IconProps) {
  const Icon = ICONS[name] ?? IconBox
  return <Icon {...props} />
}
