{#if selectedTab === 'export'}

Export Events

{#if isLoggedIn && userRole === 'owner'}

Export All Events

Download the complete database as a JSONL file. This includes all events from all users.

{:else if isLoggedIn}

Export My Events

Download your personal events as a JSONL file.

{:else} {/if}
{:else if selectedTab === 'import'}

Import Events

{#if isLoggedIn && (userRole === 'admin' || userRole === 'owner')}

Import Events

Upload a JSONL file to import events into the database.

{:else if isLoggedIn}

❌ Admin or owner permission required for import functionality.

{:else} {/if}
{:else if selectedTab === 'myevents'}

My Events

{#if isLoggedIn}

View and manage your personal events.

{#if myEvents.length > 0} {#each myEvents as event}
Kind {event.kind} {new Date(event.created_at * 1000).toLocaleString()}
{event.content}
{/each} {:else}

No events found.

{/if}
{:else} {/if}
{:else if selectedTab === 'allevents'}

All Events

{#if isLoggedIn && (userRole === 'write' || userRole === 'admin' || userRole === 'owner')}

View all events in the database.

{#if allEvents.length > 0} {#each allEvents as event}
Kind {event.kind} {new Date(event.created_at * 1000).toLocaleString()}
{event.content}
{/each} {:else}

No events found.

{/if}
{:else if isLoggedIn}

❌ Write, admin, or owner permission required to view all events.

{:else} {/if}
{:else}
{#if isLoggedIn}

Welcome {userProfile?.name || userPubkey.slice(0, 8) + '...'}

{:else}

Log in to access your user dashboard

{/if}
{/if}