MCPcopy Create free account
hub / github.com/bewcloud/bewcloud / defaultHtmlContent

Function defaultHtmlContent

pages/calendars.ts:37–67  ·  view source on GitHub ↗
({ userCalendars }: { userCalendars: Calendar[] })

Source from the content-addressed store, hash-verified

35}
36
37function defaultHtmlContent({ userCalendars }: { userCalendars: Calendar[] }) {
38 return html`
39 <main id="main">
40 <section id="calendars">
41 ${Loading()}
42 </section>
43 </main>
44
45 <script type="module">
46 import { h, render, Fragment } from 'preact';
47
48 // Imported files need some preact globals to work
49 window.h = h;
50 window.Fragment = Fragment;
51
52 import Calendars from '/public/components/calendar/Calendars.js';
53
54 const calendarsElement = document.getElementById('calendars');
55
56 if (calendarsElement) {
57 const calendarsApp = h(Calendars, {
58 initialCalendars: ${JSON.stringify(userCalendars || [])},
59 });
60
61 render(calendarsApp, calendarsElement);
62
63 document.getElementById('loading')?.remove();
64 }
65 </script>
66 `;
67}
68
69export default page({
70 get,

Callers 1

getFunction · 0.70

Calls 1

LoadingFunction · 0.50

Tested by

no test coverage detected