fix: strip quotes from icon names in DynamicIcon

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
CCS Admin 2026-02-16 16:01:30 +00:00
parent 9fe9876de2
commit 6c69491c96

View file

@ -12,8 +12,11 @@ interface DynamicIconProps {
* Names can be kebab-case ("shield-check") or PascalCase ("ShieldCheck").
*/
export function DynamicIcon({ name, size = 24, className, strokeWidth = 2 }: DynamicIconProps) {
// Convert kebab-case to PascalCase: "shield-check" → "ShieldCheck"
const pascalName = name
// Strip surrounding quotes if present (e.g. "shield" -> shield)
const cleanName = name.replace(/^["']|["']$/g, '').trim()
// Convert kebab-case to PascalCase: "shield-check" -> "ShieldCheck"
const pascalName = cleanName
.split('-')
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
.join('')