diff --git a/helpers/factory.tsx b/helpers/factory.tsx index 0b23125..a42e002 100644 --- a/helpers/factory.tsx +++ b/helpers/factory.tsx @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { FC } from "react"; -interface MenuItemConfig { +interface ComponentConfig { Component: FC; key: string; getProps: (baseProps: any) => any; @@ -9,14 +9,15 @@ interface MenuItemConfig { } export interface FactoryConfig { - items: MenuItemConfig[]; + items: ComponentConfig[]; } export const createDynamicComponentFactory = (config: FactoryConfig) => ({ generateItems: (baseProps: any) => { return config.items .filter( - (itemConfig) => !itemConfig.condition || itemConfig.condition(baseProps) + (componentConfig) => + !componentConfig.condition || componentConfig.condition(baseProps) ) .map(({ Component, key, getProps }) => (