import React, { PropsWithChildren, useMemo } from 'react'; import { UnknowPorps } from '../../../context'; interface PluginsElementProps { plugin?: Array>, showNumber?: number, } export function usePluginsElement ( props: PropsWithChildren, ) { const { plugin, showNumber = 1 } = props; return useMemo(() => { const elements = plugin?.map((Item: any, index:number) => { const key = `${JSON.stringify(Item)}${index}`; return (); }); return { showPicker: elements?.splice(0, showNumber), elements, }; }, [plugin]); }