isJSON validation was added

This commit is contained in:
Vladimir Khvan 2023-06-07 22:24:10 +05:00
parent ba3440b8eb
commit 766c695466

View File

@ -89,14 +89,18 @@ const ResponseDetails = ({ eventDetails }) => {
<Text as="h3" fontWeight={600} className="mb-4 mt-7">
{t("ResponsePostHeader")}
</Text>
<Textarea
value={eventDetails.responseHeaders}
enableCopy
hasNumeration
isFullHeight
isJSONField
copyInfoText={t("ResponseHeaderCopied")}
/>
{isJSON(eventDetails.responseHeaders) ? (
<Textarea
value={eventDetails.responseHeaders}
enableCopy
hasNumeration
isFullHeight
isJSONField
copyInfoText={t("ResponseHeaderCopied")}
/>
) : (
<Textarea value={eventDetails.responseHeaders} heightScale className="textareaBody" />
)}
<Text as="h3" fontWeight={600} className="mb-4 mt-16">
{t("ResponsePostBody")}
</Text>