import { __ } from '@wordpress/i18n';
import { createAnswerField } from './answer-field';

declare module '@tiptap/core' {
	interface Commands<ReturnType> {
		longAnswer: {
			insertLongAnswer: (attrs?: {
				label?: string;
				required?: boolean;
			}) => ReturnType;
		};
	}
}

export const LongAnswer = createAnswerField({
	name: 'longAnswer',
	dataType: 'long-answer',
	typeLabel: __('Long Answer', 'allcoach'),
	previewText: __('Long answer…', 'allcoach'),
	commandName: 'insertLongAnswer',
	multiline: true,
});
