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

  let { node }: { node: TreeNode } = $props();
</script>

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