| 
									
										
										
										
											2024-08-29 02:46:51 +02:00
										 |  |  | <script lang="ts"> | 
					
						
							|  |  |  |   // A fake 'page' which can be shown; kind of a modal | 
					
						
							|  |  |  |   import { UIEventSource } from "../../Logic/UIEventSource" | 
					
						
							|  |  |  |   import { Modal } from "flowbite-svelte" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   export let shown: UIEventSource<boolean> | 
					
						
							|  |  |  |   let _shown = false | 
					
						
							|  |  |  |   export let onlyLink: boolean = false | 
					
						
							|  |  |  |   shown.addCallbackAndRun(sh => { | 
					
						
							|  |  |  |     _shown = sh | 
					
						
							|  |  |  |   }) | 
					
						
							|  |  |  |   export let fullscreen: boolean = false | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   const shared = "defaultClass normal-background dark:bg-gray-800 rounded-lg border-gray-200 dark:border-gray-700 border-gray-200 dark:border-gray-700 divide-gray-200 dark:divide-gray-700 shadow-md" | 
					
						
							|  |  |  |   let defaultClass = "relative flex flex-col mx-auto w-full divide-y " + shared | 
					
						
							|  |  |  |   if (fullscreen) { | 
					
						
							|  |  |  |     defaultClass = shared | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2024-08-29 03:53:54 +02:00
										 |  |  |   let dialogClass = "fixed top-0 start-0 end-0 h-modal inset-0 z-50 w-full p-4 flex" | 
					
						
							|  |  |  |   if (fullscreen) { | 
					
						
							| 
									
										
										
										
											2024-08-29 02:46:51 +02:00
										 |  |  |     dialogClass += " h-full-child" | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   let bodyClass = "h-full p-4 md:p-5 space-y-4 flex-1 overflow-y-auto overscroll-contain" | 
					
						
							| 
									
										
										
										
											2024-08-29 03:53:54 +02:00
										 |  |  |   let headerClass = "flex justify-between items-center p-2 px-4 md:px-5 rounded-t-lg"; | 
					
						
							| 
									
										
										
										
											2024-08-29 02:46:51 +02:00
										 |  |  | </script> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {#if !onlyLink} | 
					
						
							| 
									
										
										
										
											2024-08-29 03:53:54 +02:00
										 |  |  |   <Modal open={_shown} on:close={() => shown.set(false)} size="xl" {defaultClass} {bodyClass} {dialogClass} {headerClass} | 
					
						
							|  |  |  |          color="none"> | 
					
						
							|  |  |  |     <h1 slot="header" class="w-full"> | 
					
						
							|  |  |  |       <slot name="header" /> | 
					
						
							|  |  |  |     </h1> | 
					
						
							| 
									
										
										
										
											2024-08-29 02:46:51 +02:00
										 |  |  |     <slot /> | 
					
						
							|  |  |  |     {#if $$slots.footer} | 
					
						
							|  |  |  |       <slot name="footer" /> | 
					
						
							|  |  |  |     {/if} | 
					
						
							|  |  |  |   </Modal> | 
					
						
							|  |  |  | {:else} | 
					
						
							|  |  |  |   <button class="as-link" on:click={() => shown.setData(true)}> | 
					
						
							| 
									
										
										
										
											2024-08-29 03:53:54 +02:00
										 |  |  |     <slot name="link"> | 
					
						
							| 
									
										
										
										
											2024-08-29 02:46:51 +02:00
										 |  |  |     <slot name="header" /> | 
					
						
							| 
									
										
										
										
											2024-08-29 03:53:54 +02:00
										 |  |  |     </slot> | 
					
						
							| 
									
										
										
										
											2024-08-29 02:46:51 +02:00
										 |  |  |   </button> | 
					
						
							|  |  |  | {/if} |