mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-06-16 17:48:34 +02:00
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:
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user