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

import './module.scss';

metadata.attributes = { ...metadata.attributes, ...generateModuleAttributes( 'checkboxes' ) };

export const checkboxesFilter: ModuleLibrary.Module.RegisterDefinition<CheckboxesFilterAttrs> = {
	metadata: metadata as Metadata.Values<CheckboxesFilterAttrs>,
	placeholderContent,
	settings: {
		content:  SettingsContent,
		design:   SettingsDesign,
		advanced: SettingsAdvanced,
	},
	renderers: {
		edit: CheckboxesFilterEdit,
	},
};
