import { h } from "./jsx";
import { Sidebar } from "./components/Sidebar";
import { PaliadinWidget } from "./components/PaliadinWidget";
import { BottomNav } from "./components/BottomNav";
import { Footer } from "./components/Footer";
import { PWAHead } from "./components/PWAHead";

export function renderAdminBroadcasts(): string {
  return "<!DOCTYPE html>" + (
    <html lang="de">
      <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
        <meta name="theme-color" content="#BFF355" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="default" />
        <PWAHead />
        <title data-i18n="admin.broadcasts.title">Broadcasts &mdash; Paliad</title>
        <link rel="stylesheet" href="/assets/global.css" />
      </head>
      <body className="has-sidebar">
        <Sidebar currentPath="/admin/broadcasts" />
        <BottomNav currentPath="/admin/broadcasts" />

        <main>
          <section className="tool-page">
            <div className="container">
              <div className="tool-header">
                <div>
                  <h1 data-i18n="admin.broadcasts.heading">Broadcasts</h1>
                  <p className="tool-subtitle" data-i18n="admin.broadcasts.subtitle">
                    Versendete Massen-E-Mails an Teamauswahlen.
                  </p>
                </div>
              </div>

              <div className="entity-table-wrap">
                <table className="entity-table entity-table--readonly broadcasts-table">
                  <thead>
                    <tr>
                      <th data-i18n="admin.broadcasts.col.sent_at">Gesendet</th>
                      <th data-i18n="admin.broadcasts.col.subject">Betreff</th>
                      <th data-i18n="admin.broadcasts.col.sender">Absender:in</th>
                      <th data-i18n="admin.broadcasts.col.count">Empf&auml;nger</th>
                    </tr>
                  </thead>
                  <tbody id="broadcasts-tbody">
                    <tr><td colspan={4} data-i18n="admin.broadcasts.loading">Lade ...</td></tr>
                  </tbody>
                </table>
              </div>

              <div className="entity-empty" id="broadcasts-empty" style="display:none">
                <p data-i18n="admin.broadcasts.empty">Noch keine Broadcasts versandt.</p>
              </div>

              <div id="broadcast-detail" className="hidden" />
            </div>
          </section>
        </main>

        <Footer />
        <PaliadinWidget />
        <script src="/assets/admin-broadcasts.js"></script>
      </body>
    </html>
  );
}
