<script lang="ts"> import App from "./App.svelte"; import SingleDialogComponent from "./SingleDialogComponent.svelte"; import type { Dialog, DialogMap } from "./types"; export let startDialogName: string; export let dialogs: DialogMap; let currentDialog = dialogs[startDialogName]; function switchDialog(targetDialog: string) { currentDialog = dialogs[targetDialog]; } function checkForInvalidDialogReferences() { const allDialogKeys = Object.keys(dialogs); for (const dialogName of allDialogKeys) { // TODO check all buttons for invalid references } } </script> <SingleDialogComponent {...currentDialog} on:switchToDialog={(event) => switchDialog(event.detail)} />