21 lines
718 B
PHP
21 lines
718 B
PHP
@php
|
|
$payload = $getState();
|
|
$json = is_string($payload) ? $payload : json_encode($payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
|
|
@endphp
|
|
|
|
<div class="space-y-2">
|
|
<div class="flex items-center justify-between text-sm font-semibold text-gray-800">
|
|
<span>Raw JSON</span>
|
|
<button
|
|
type="button"
|
|
x-data
|
|
@click="navigator.clipboard.writeText(@js($json ?? ''))"
|
|
class="text-xs font-medium text-blue-600 hover:text-blue-800"
|
|
>
|
|
Copy
|
|
</button>
|
|
</div>
|
|
|
|
<pre class="overflow-x-auto rounded border border-gray-200 bg-gray-50 p-3 text-xs text-gray-800"><code class="language-json">{{ $json }}</code></pre>
|
|
</div>
|