UNPKG

@progress/sitefinity-nextjs-sdk

Version:

Provides OOB widgets developed using the Next.js framework, which includes an abstraction layer for Sitefinity communication. Additionally, it offers an expanded API, typings, and tools for further development and integration.

18 lines (17 loc) 822 B
'use client'; import { ServiceMetadata } from '@progress/sitefinity-nextjs-sdk/rest-sdk'; /** * Widget filter function for Results widget. * Filters the widget based on whether the Agentic RAG Connector module is enabled in Sitefinity. * @param widgetMetadata The metadata of the widget to filter. * @param args The arguments from the getWidgets call containing toolbox, category, search criteria. * @returns Promise<boolean> True if the widget should be included in the results, false otherwise. */ export async function filterResultsWidget(widgetMetadata, args) { // Only apply filtering logic to SitefinityResults widget if (widgetMetadata.designerMetadata?.Name !== 'SitefinityResults') { return true; } const isEnabled = ServiceMetadata.isModuleEnabled('parag'); return isEnabled; }