Add content check for JSON preview

This commit is contained in:
Serkan Reis 2023-10-17 09:20:30 +03:00
parent e99832c283
commit 7e084b01d7

View File

@ -66,7 +66,7 @@ export const JsonPreview = ({
</div>
{show && (
<div className="overflow-auto p-2 font-mono text-sm">
<pre>{JSON.stringify(content, null, 2).trim()}</pre>
<pre>{content ? JSON.stringify(content, null, 2).trim() : '{}'}</pre>
</div>
)}
</div>