langflow/docs/src/components/icon/index.tsx
Cristhian Zanforlin Lousa 50ac92dda4
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
2024-11-18 09:55:02 -08:00

19 lines
386 B
TypeScript

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;
}