import type { ToolbarConfig, ToolbarOption } from './richTextTypes'

export const tableTools: ToolbarConfig = [
	'mergeCells',
	'splitCells',
	'addRowBefore',
	'addRowAfter',
	'deleteRow',
	'insertColumnLeft',
	'insertColumnRight',
	'deleteColumn',
	'alignLeft',
	'alignCenter',
	'alignRight',
	'alignJustify',
	'deleteTable'
]

export const basicToolbarConfig: ToolbarConfig = [
	'h2',
	'h3',
	'h4',
	'h5',
	'h6',
	'separator',
	'p',
	'blockquote',
	'orderedList',
	'unorderedList',
	'separator',
	'bold',
	'italic',
	'underline',
	'separator',
	'link',
	'image',
	'embed',
	'clear',
	'splitView',
	'fullScreen',
]

export const fullToolbarConfig: ToolbarConfig = [
	'h2',
	'h3',
	'h4',
	'h5',
	'h6',
	'separator',
	'bold',
	'italic',
	'underline',
	'separator',
	'fontColor',
	'bgColor',
	'separator',
	'p',
	'blockquote',
	'orderedList',
	'unorderedList',
	'indent',
	'outdent',
	'separator',
	'link',
	'image',
	'embed',
	'separator',
	'splitView',
	'clear',
	'insertTable',
	...tableTools,
	'separator',
	'undo',
	'redo',
	'fullScreen',
]

export const toolbarOptions: ToolbarOption[] = [
	{ name: 'h2', label: 'h2', icon: 'format_h2' },
	{ name: 'h3', label: 'h3', icon: 'format_h3' },
	{ name: 'h4', label: 'h4', icon: 'format_h4' },
	{ name: 'h5', label: 'h5', icon: 'format_h5' },
	{ name: 'h6', label: 'h6', icon: 'format_h6' },
	{ name: 'p', label: 'Paragraph', icon: 'format_paragraph' },
	{ name: 'blockquote', label: 'Blockquote', icon: 'format_quote' },
	{ name: 'bold', label: 'Bold', icon: 'format_bold' },
	{ name: 'italic', label: 'Italic', icon: 'format_italic' },
	{ name: 'underline', label: 'Underline', icon: 'format_underlined' },
	{ name: 'orderedList', label: 'Ordered List', icon: 'format_list_numbered' },
	{ name: 'unorderedList', label: 'Unordered List', icon: 'format_list_bulleted' },
	{ name: 'link', label: 'Link', icon: 'add_link' },
	{ name: 'image', label: 'Image', icon: 'add_photo_alternate' },
	{ name: 'embed', label: 'Embed', icon: 'media_link' },
	{ name: 'splitView', label: 'Split View', icon: 'code' },
	{ name: 'clear', label: 'Clear Formatting', icon: 'format_clear' },
	{ name: 'alignLeft', label: 'Align Left', icon: 'format_align_left' },
	{ name: 'alignCenter', label: 'Align Center', icon: 'format_align_center' },
	{ name: 'alignRight', label: 'Align Right', icon: 'format_align_right' },
	{ name: 'alignJustify', label: 'Align Justify', icon: 'format_align_justify' },
	{ name: 'indent', label: 'Indent', icon: 'format_indent_increase' },
	{ name: 'outdent', label: 'Outdent', icon: 'format_indent_decrease' },
	{ name: 'fontColor', label: 'Font Color', icon: 'format_color_text' },
	{ name: 'bgColor', label: 'Background Color', icon: 'format_color_fill' },
	{ name: 'insertTable', label: 'Insert Table', icon: 'table' },
	{ name: 'deleteTable', label: 'Delete Table', icon: 'delete_sweep' },
	{ name: 'mergeCells', label: 'Merge Cells', icon: 'table_chart' },
	{ name: 'splitCells', label: 'Split Cells', icon: 'dashboard' },
	{ name: 'addRowBefore', label: 'Insert Row Above', icon: 'add_box' },
	{ name: 'addRowAfter', label: 'Insert Row Below', icon: 'vertical_align_bottom' },
	{ name: 'deleteRow', label: 'Delete Row', icon: 'remove' },
	{ name: 'insertColumnLeft', label: 'Insert Column Left', icon: 'format_indent_decrease' },
	{ name: 'insertColumnRight', label: 'Insert Column Right', icon: 'format_indent_increase' },
	{ name: 'deleteColumn', label: 'Delete Column', icon: 'view_week' },
	{ name: 'separator' },
	{ name: 'undo', label: 'Undo', icon: 'undo' },
	{ name: 'redo', label: 'Redo', icon: 'redo' },
	{ name: 'separator' },
	{ name: 'fullScreen', label: 'Full Screen', icon: 'fullscreen', class: 'ms-auto' },
]
