Allow referencing of properties of child elements using the each syntax.
import {
{{#each children}}
{{property.type|pascal}}Icon,
{{/each}}
} from "@heroicons/react/24/solid";
import { FC } from "react";
export const MyIcon: FC<{ type: string }> = ({ type }) => {
switch (type) {
{{#each children}}
case "{{property.type}}":
return <{{property.type|pascal}}Icon className="h-6 w-6 text-blue-500" />;
{{/each}}
default:
return null;
}
};
import {
AdjustmentsHorizontalIcon,
ArrowDownRightIcon,
Bars3Icon,
} from "@heroicons/react/24/solid";
import { FC } from "react";
export const MyIcon: FC<{ type: string }> = ({ type }) => {
switch (type) {
case "adjustments-horizontal":
return <AdjustmentsHorizontalIcon className="h-6 w-6 text-blue-500" />;
case "arrow-down-right":
return <ArrowDownRightIcon className="h-6 w-6 text-blue-500" />;
case "bars-3":
return <Bars3Icon className="h-6 w-6 text-blue-500" />;
default:
return null;
}
};