import { lazyRetry } from 'src/utils/lazyRetry';
import { ROUTE_PERMISSIONS } from 'src/utils/permissions';

import { type SidebarItemProps } from '../../sidebar/types';

const NavLibraryItem = lazyRetry(() => import('../../sidebar/items/Library'));

const useLibrarySidebarItem = (itemProps: SidebarItemProps) => {
  return {
    key: 'library',
    component: <NavLibraryItem {...itemProps} />,
    requiredPermissions: ROUTE_PERMISSIONS.KNOWLEDGE_LIBRARY,
  };
};

export default useLibrarySidebarItem;
