Skip to content

Commit de68779

Browse files
committed
Merge branch 'feature/audio-rendering'
2 parents 8e227bf + 66b1b73 commit de68779

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

client/src/components/ToolsTab.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,19 @@ const ToolsTab = ({
8888
/>
8989
)}
9090
{item.type === "resource" && (
91-
<pre className="bg-gray-50 dark:bg-gray-800 dark:text-gray-100 whitespace-pre-wrap break-words p-4 rounded text-sm overflow-auto max-h-64">
92-
{JSON.stringify(item.resource, null, 2)}
93-
</pre>
91+
item.resource?.mimeType?.startsWith("audio/") ? (
92+
<audio
93+
controls
94+
src={`data:${item.resource.mimeType};base64,${item.resource.blob}`}
95+
className="w-full"
96+
>
97+
<p>Your browser does not support audio playback</p>
98+
</audio>
99+
) : (
100+
<pre className="bg-gray-50 dark:bg-gray-800 dark:text-gray-100 whitespace-pre-wrap break-words p-4 rounded text-sm overflow-auto max-h-64">
101+
{JSON.stringify(item.resource, null, 2)}
102+
</pre>
103+
)
94104
)}
95105
</div>
96106
))}

0 commit comments

Comments
 (0)