import {
	type Metadata,
	type ModuleLibrary,
} from '@divi/types';
import { ActiveFiltersEdit } from './edit';
import metadata from './module.json';
import { SettingsAdvanced } from './settings-advanced';
import { SettingsContent } from './settings-content';
import { SettingsDesign } from './settings-design';
import { ActiveFiltersAttrs } from './types';
import { placeholderContent } from './placeholder-content';

import './module.scss';

export const activeFilters: ModuleLibrary.Module.RegisterDefinition<ActiveFiltersAttrs> = {
	// Imported json has no inferred type hence type-cast is necessary.
	metadata: metadata as Metadata.Values<ActiveFiltersAttrs>,
	placeholderContent,
	settings: {
		content:  SettingsContent,
		design:   SettingsDesign,
		advanced: SettingsAdvanced,
	},
	renderers: {
		edit: ActiveFiltersEdit,
	},
};
