fix: add defaultValue to Tabs components in all viewers

The Radix UI Tabs component requires a defaultValue prop to indicate
which tab should be active by default. Without it, no tab content is
rendered because the Tabs component doesn't know which content to show.

Added defaultValue={spells[0]?.id} to:
- ProfileViewer (pubkeySpells)
- EventDetailViewer (eventSpells)
- RelayViewer (relaySpells)

This ensures the first spell tab is selected and visible when the
viewer loads with available spells.
This commit is contained in:
Claude
2026-01-23 14:35:15 +00:00
parent 60c731d349
commit b0e0240c37
3 changed files with 12 additions and 3 deletions

View File

@@ -428,7 +428,10 @@ export function EventDetailViewer({ pointer }: EventDetailViewerProps) {
{/* Spell Tabs */}
<div className="border-t border-border flex-1 overflow-hidden flex flex-col min-h-0">
{eventSpells.length > 0 ? (
<Tabs className="flex flex-col h-full">
<Tabs
defaultValue={eventSpells[0]?.id}
className="flex flex-col h-full"
>
<div className="flex items-center border-b">
<Button
variant="ghost"

View File

@@ -805,7 +805,10 @@ export function ProfileViewer({ pubkey }: ProfileViewerProps) {
{/* Spell Tabs */}
<div className="border-t border-border flex-1 overflow-hidden flex flex-col min-h-0">
{pubkeySpells.length > 0 ? (
<Tabs className="flex flex-col h-full">
<Tabs
defaultValue={pubkeySpells[0]?.id}
className="flex flex-col h-full"
>
<div className="flex items-center border-b">
<Button
variant="ghost"

View File

@@ -323,7 +323,10 @@ export function RelayViewer({ url }: RelayViewerProps) {
{/* Spell Tabs */}
<div className="border-t border-border flex-1 overflow-hidden flex flex-col min-h-0">
{relaySpells.length > 0 ? (
<Tabs className="flex flex-col h-full">
<Tabs
defaultValue={relaySpells[0]?.id}
className="flex flex-col h-full"
>
<div className="flex items-center border-b">
<Button
variant="ghost"