refactor<genericIconComponent>: Remove unnused SVG icon method
This commit is contained in:
parent
1dcabe6751
commit
c6ffb9a698
2 changed files with 1 additions and 13 deletions
|
|
@ -1,4 +1,3 @@
|
||||||
import { Info } from "lucide-react";
|
|
||||||
import React, { useContext, useEffect, useRef, useState } from "react";
|
import React, { useContext, useEffect, useRef, useState } from "react";
|
||||||
import { Handle, Position, useUpdateNodeInternals } from "reactflow";
|
import { Handle, Position, useUpdateNodeInternals } from "reactflow";
|
||||||
import ShadTooltip from "../../../../components/ShadTooltipComponent";
|
import ShadTooltip from "../../../../components/ShadTooltipComponent";
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { IconComponentProps, IconProps } from "../../types/components";
|
import { IconComponentProps, IconProps } from "../../types/components";
|
||||||
import { nodeIconsLucide, svgIcons } from "../../utils";
|
import { nodeIconsLucide } from "../../utils";
|
||||||
|
|
||||||
export function IconFromLucide({
|
export function IconFromLucide({
|
||||||
name,
|
name,
|
||||||
|
|
@ -10,15 +10,6 @@ export function IconFromLucide({
|
||||||
return <TargetIcon className={ style } style={{ color: iconColor }} />;
|
return <TargetIcon className={ style } style={{ color: iconColor }} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function IconFromSvg({
|
|
||||||
name,
|
|
||||||
style,
|
|
||||||
iconColor,
|
|
||||||
}: IconProps): JSX.Element {
|
|
||||||
const TargetSvg = svgIcons[name] ?? nodeIconsLucide["unknown"];
|
|
||||||
return <TargetSvg className={ style } />;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function IconComponent({
|
export default function IconComponent({
|
||||||
method,
|
method,
|
||||||
name,
|
name,
|
||||||
|
|
@ -26,8 +17,6 @@ export default function IconComponent({
|
||||||
iconColor,
|
iconColor,
|
||||||
}: IconComponentProps): JSX.Element {
|
}: IconComponentProps): JSX.Element {
|
||||||
switch (method) {
|
switch (method) {
|
||||||
case "SVG":
|
|
||||||
return <IconFromSvg name={name} style={ style } iconColor={ iconColor } />;
|
|
||||||
case "LUCIDE":
|
case "LUCIDE":
|
||||||
return <IconFromLucide name={name} style={ style } iconColor={ iconColor } />;
|
return <IconFromLucide name={name} style={ style } iconColor={ iconColor } />;
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue