diff --git a/src/lib/components/publications/TableOfContents.svelte b/src/lib/components/publications/TableOfContents.svelte
index 3c0b8f1..08097ed 100644
--- a/src/lib/components/publications/TableOfContents.svelte
+++ b/src/lib/components/publications/TableOfContents.svelte
@@ -4,17 +4,13 @@
type TocEntry
} from '$lib/components/publications/table_of_contents.svelte';
import { getContext } from 'svelte';
- import { Accordion, AccordionItem, SidebarDropdownWrapper, SidebarGroup, SidebarItem } from 'flowbite-svelte';
+ import { SidebarDropdownWrapper, SidebarGroup, SidebarItem } from 'flowbite-svelte';
import Self from './TableOfContents.svelte';
- export type TocDisplayMode = 'accordion' | 'sidebar';
-
let {
- displayMode = 'accordion',
depth,
onSectionFocused,
- } = $props<{
- displayMode?: TocDisplayMode;
+ } = $props<{
rootAddress: string;
depth: number;
onSectionFocused?: (address: string) => void;
@@ -46,65 +42,36 @@
}
-
-{#if displayMode === 'accordion'}
-
- {#each entries as entry}
- {@const address = entry.address}
- {@const expanded = toc.expandedMap.get(address) ?? false}
-
+
+
+ {#each entries as entry}
+ {@const address = entry.address}
+ {@const expanded = toc.expandedMap.get(address) ?? false}
+ {@const isLeaf = toc.leaves.has(address)}
+ {#if isLeaf}
+ onSectionFocused?.(address)}
+ />
+ {:else}
+ {@const childDepth = depth + 1}
+ expanded,
(open) => setEntryExpanded(address, open)
}
>
- {#snippet header()}
- {entry.title}
- {/snippet}
- {#if entry.children.length > 0}
-
- {/if}
-
- {/each}
-
-{:else}
-
-
-
- {#each entries as entry}
- {@const address = entry.address}
- {@const expanded = toc.expandedMap.get(address) ?? false}
- {@const isLeaf = toc.leaves.has(address)}
- {#if isLeaf}
- onSectionFocused?.(address)}
+
- {:else}
- {@const childDepth = depth + 1}
- expanded,
- (open) => setEntryExpanded(address, open)
- }
- >
-
-
- {/if}
- {/each}
-
-{/if}
+
+ {/if}
+ {/each}
+