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

import './module.scss';

metadata.attributes = { ...metadata.attributes, ...generateModuleAttributes('mapsListing') }

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