/**
 * BLOCK: Fields Settings
 */

import {__} from '@wordpress/i18n';

export const fields = {
		title: {
			type: 'text',
			label: __('Block Title', 'flo'),
			conditional: 0,
		},
		titleTypography: {
			type: 'typography',
			label: __('Title Typography', 'flo'),
		},
		textElementsColor: {
			type: 'color',
			label: __('Elements Color', 'flo'),
		},
		testimonials: {
			type: 'repeater',
			label: __('Testimonials', 'flo'),
			row_title: 'title',
			fields: {
				image: {
					type: 'image',
					label: __('Testimonial Image', 'flo'),
				},
				avatar: {
					type: 'image',
					label: __('Testimonial Avatar', 'flo'),
				},
				title: {
					id: 'title',
					type: 'text',
					label: __('Author', 'flo'),
					default: __('Author name', 'flo'),
				},
				text: {
					id: 'text',
					type: 'textarea',
					label: __('Text', 'flo'),
					default: __(
						'If you’re in need of photos with a personal touch, then I’m the girl for you.Default text',
						'flo'
					),
				},
			},
		},
		imageWidth: {
			type: 'range',
			label: __('Image Width', 'flo'),
			min: 0,
			max: 500,
		},
		authorTypography: {
			type: 'typography',
			label: __('Testimonial Author Typography', 'flo'),
		},
		textTypography: {
			type: 'typography',
			label: __('Testimonial Text Typography', 'flo'),
		},
		scrollThrouchText: {
			type: 'text',
			label: __('Scroll Through Text', 'flo'),
		},
		scrollThrouchTypography: {
			type: 'typography',
			label: __('Scroll Through Typography', 'flo'),
		},

		topMargin: {
			type: 'range',
			label: __('Desktop Top Margin Correction', 'flo'),
			min: -100,
			max: 100,
		},
		bottomMargin: {
			type: 'range',
			label: __('Desktop Bottom Margin Correction', 'flo'),
			min: -100,
			max: 100,
		},
		mobileTopMargin: {
			type: 'range',
			label: __('Mobile Top Margin Correction', 'flo'),
			min: -100,
			max: 100,
		},
		mobileBottomMargin: {
			type: 'range',
			label: __('Mobile Bottom Margin Correction', 'flo'),
			min: -100,
			max: 100,
		},
	},
	groups = [
		{
			name: __('General', 'flo'),
			fields: [
				'title',
				'titleTypography',
				'textElementsColor',
				'testimonials',
				'imageWidth',
				'authorTypography',
				'textTypography',
				'scrollThrouchText',
				'scrollThrouchTypography',
			],
			open: true,
		},
		{
			name: __('Margins', 'flo'),
			fields: [
				'topMargin',
				'bottomMargin',
				'mobileTopMargin',
				'mobileBottomMargin',
			],
			open: false,
		},
	];
