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

import './module.scss';

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

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