/**
 * WordPress dependencies
 */
/**
 * External dependencies
 */
import { CodeEditor } from '@nab/components';

/**
 * Internal dependencies
 */
import './style.scss';
import type { AlternativeAttributes } from '../../types';

export type ValuePreviewProps = {
	readonly attributes: AlternativeAttributes;
};

export const ValuePreview = ( {
	attributes: { snippet },
}: ValuePreviewProps ): JSX.Element => (
	<CodeEditor
		className="nab-php-value-preview"
		language="php"
		before="<?php"
		value={ snippet }
		readOnly
	/>
);
