docs: add icons component with lucide-react integration (#4682)

* ✨ (package.json): add lucide-react package to dependencies for using Lucide icons in the project
✨ (index.tsx): create a new Icon component to render Lucide icons with specified name, size, and color properties

* ♻️ (package.json): remove lucide-react dependency as it is no longer needed in the project

* ⬆️ (package.json): upgrade lucide-react dependency to version 0.460.0
This commit is contained in:
Cristhian Zanforlin Lousa 2024-11-18 14:55:02 -03:00 • committed by GitHub
commit 50ac92dda4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 289 additions and 305 deletions

View file

@ -0,0 +1,19 @@
import React from "react";
import * as LucideIcons from "lucide-react";
/*
How to use this component:
import Icon from "@site/src/components/icon";
<Icon name="AlertCircle" size={24} color="red" />
*/
type IconProps = {
name: string;
};
export default function Icon({ name, ...props }: IconProps) {
const Icon = LucideIcons[name];
return Icon ? <Icon {...props} /> : null;
}