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

import { TotalBlock } from './render/OrderTotals';
import { Icon } from './icon';
import { TOTAL_BLOCK_NAMESPACE } from './constants/types';
import { totalBlockToHTML } from './toHTML';

export const totalBlock = {
	namespace: TOTAL_BLOCK_NAMESPACE,
	label: __('Order Totals', 'pdfdraft-pdf-invoices-for-woocommerce'),
	category: 'woocommerce',
	icon: Icon,
	keywords: ['total', 'subtotal', 'discount', 'tax', 'woocommerce'],
	tier: 'free',
	render: TotalBlock,
	toHTML: totalBlockToHTML as any,
	getInitialDimensions: () => ({ width: 100, height: 130 }),
	getInitialContent: () => '',
} as any;
