Roo-Code/apps/docs/src/components/LucideIcon.tsx
Bruno Bergher 28acb6acf2
Add docs app and GitHub Pages deploy (#12344)
* Add docs app and Pages deploy

* Configure knip for docs app
2026-05-12 14:23:21 +01:00

30 lines
697 B
TypeScript

import React from "react"
import * as LucideIcons from "lucide-react"
import type { LucideProps } from "lucide-react"
interface LucideIconProps {
name: keyof typeof LucideIcons
size?: number
color?: string
strokeWidth?: number
className?: string
style?: React.CSSProperties
}
export default function LucideIcon({
name,
size = 20,
color,
strokeWidth,
className,
style,
}: LucideIconProps): React.JSX.Element | null {
const Icon = LucideIcons[name] as React.ComponentType<LucideProps>
if (!Icon) {
console.warn(`Icon "${name}" not found in lucide-react`)
return null
}
return <Icon size={size} color={color} strokeWidth={strokeWidth} className={className} style={style} />
}