File size: 543 Bytes
cd8bd0a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"use client";

interface PayloadPreviewProps {
  payload: Record<string, unknown> | null;
  label?: string;
}

export function PayloadPreview({ payload, label }: PayloadPreviewProps) {
  if (!payload) return null;
  return (
    <div className="space-y-1">
      {label && (
        <p className="text-xs font-medium uppercase tracking-wider text-text-muted">{label}</p>
      )}
      <pre className="overflow-x-auto rounded-lg bg-sidebar p-3 text-xs text-text-main">
        {JSON.stringify(payload, null, 2)}
      </pre>
    </div>
  );
}