/**
 * External dependencies
 */
import {registerBlockType} from '@wordpress/blocks';
import {__} from '@wordpress/i18n';

import './style.scss';
import './editor.scss';

import Edit from './edit';
registerBlockType('flo-block/category-switcher', {
	title: __('Flo Category Switcher'),
	description: __('Category Switcher'),
	icon: (
		<svg
			width="24"
			height="24"
			viewBox="0 0 24 24"
			fill="none"
			xmlns="http://www.w3.org/2000/svg"
		>
			<path d="M12 2L6.5 11H17.5L12 2Z" fill="black" />
			<path
				d="M17.5 22C19.9853 22 22 19.9853 22 17.5C22 15.0147 19.9853 13 17.5 13C15.0147 13 13 15.0147 13 17.5C13 19.9853 15.0147 22 17.5 22Z"
				fill="black"
			/>
			<path d="M3 13.5H11V21.5H3V13.5Z" fill="black" />
		</svg>
	),
	category: 'flo',
	keywords: [__('Category'), __('Categories')],

	example: {
		attributes: {
			preview: true,
		},
	},

	supports: {
		align: ['full'],
		anchor: true,
	},

	edit: function SwitcherEdit(props) {
		return <Edit {...props} />;
	},

	save: () => {
		return null;
	},
});
