<script lang="ts">
  import { Modal } from '@sveltestrap/sveltestrap';

  const toggle = () => (open = !open);
  let {payload, close = toggle, iscomponent = false } = $props();
  let open = $state(true);

</script>

<div>
  <Modal body isOpen={open} toggle={close}>
    {#if iscomponent == false}
    {payload}
    {:else}
    {@render payload()}
    {/if}
  </Modal>
</div>
