<script lang="ts">
  import type { TreeNode, NodeId } from "./tree";
  import SplitNode from "./SplitNode.svelte";
  import LeafPane from "./LeafPane.svelte";

  let {
    node,
    activeLeafId,
  }: {
    node: TreeNode;
    activeLeafId: NodeId | null;
  } = $props();
</script>

{#if node.kind === "split"}
  <SplitNode {node} {activeLeafId} />
{:else}
  <LeafPane leaf={node} {activeLeafId} />
{/if}
