'use strict';
import * as sol from "../../solight/sol.js";
import * as serv from "../services/service.js";
const html = htm.bind(preact.h);
const speaker = (event) => {
const speaker = sol.eventPersons(event);
const names = speaker.map(s => sol.personName(s)).join(", ");
return html`${names}`;
};
const num_speaker = (event) =>
sol.eventPersons(event).length;
const event_row = (event) =>
html`
${sol.eventTitle(event)} |
${speaker(event)} |
${num_speaker(event)} |
`;
const talks_table = (events) => {
const evs = sol.sortEventsByStartDate(events);
return html`
Events (${evs.length})
Event Title |
Person(s) |
#Person(s) |
${evs.map(e => event_row(e))}
`;
};
const talks_overview = (schedule) => {
const events = sol.allEvents(schedule);
return html`
Schedule (v ${sol.scheduleVersion(schedule)})
${talks_table(events)}`;
};
const update_main_slide = (data, time) => {
if (sol.defined(data.scheduleData)) {
const schedule = data.scheduleData;
const inner = html`
${talks_overview(schedule)}`;
// Add main slide to info beamer
const anchorElId = "main";
const el = document.getElementById(anchorElId);
preact.render(inner, el);
};
};
export {
update_main_slide
};