import * as S from "./style";

const NoteField = (props: INoteFieldProps): JSX.Element => {
	const { value, className } = props;
	const { title, text } = value;

	return (
		<S.Wrapper className={className} data-testid="note-field-wrapper">
			{title && <S.Title data-testid="note-field-title">{title}</S.Title>}
			<S.Text>{text}</S.Text>
		</S.Wrapper>
	);
};

export interface INoteFieldProps {
	value: { title?: string; text: React.ReactNode };
	className?: string;
}

export default NoteField;
