/**
 * 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: { code },
}: ValuePreviewProps ): JSX.Element => (
	<CodeEditor
		className="nab-javascript-value-preview"
		language="javascript"
		value={ code }
		readOnly
	/>
);
