// Produktseite des Bots: was er kann, wie er aussieht, wo es weitergeht.
// Bewusst ohne „Einladen"-Button — der Bot ist auf einen Server ausgelegt.
import { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import { apiGet } from '../api.js';
import { useT } from '../i18n.jsx';
import { Accent } from '../components/Accent.jsx';
import {
IconDevlog, IconLevel, IconRoles, IconServer, IconSupport, IconGiveaway,
IconBirthday, IconShield, IconMagic, IconArrowRight, IconBot,
} from '../icons.jsx';
const HIGHLIGHTS = [
[IconDevlog, 'bot.hl.devlogs'],
[IconServer, 'bot.hl.monitor'],
[IconLevel, 'bot.hl.level'],
[IconRoles, 'bot.hl.roles'],
[IconSupport, 'bot.hl.support'],
[IconShield, 'bot.hl.mod'],
[IconGiveaway, 'bot.hl.giveaway'],
[IconBirthday, 'bot.hl.birthday'],
[IconMagic, 'bot.hl.welcome'],
];
export default function BotLanding() {
const { t } = useT();
const [status, setStatus] = useState(null);
const [hub, setHub] = useState(null);
const [featureCount, setFeatureCount] = useState(null);
useEffect(() => {
// Nur verlinken, wenn der Hub wirklich woanders liegt
apiGet('/api/legal').then((d) => setHub(d.split ? d.hubUrl : null)).catch(() => {});
apiGet('/api/serverstats').then(setStatus).catch(() => {});
// Zahl kommt aus dem Modul-Register, damit sie nicht veraltet
apiGet('/api/features').then((d) => setFeatureCount(d.features.length)).catch(() => {});
window.scrollTo(0, 0);
}, []);
return (
<>
{t('bot.tag')}
{t('bot.title1')}
{t('bot.subtitle')}
{t('bot.allFeatures')} {t('bot.viewCommands')}
{/* Karte mit Logo, Zustand und den vier Kennzahlen. Der versetzte
Rahmen liegt als eigenes Element dahinter — als Pseudo-Element
am Panel würde ihn dessen Abschrägung wegschneiden. */}
{/* Diese Seite liefert der Bot selbst aus — wenn sie
ankommt, läuft er. Antwortzeit und Erreichbarkeit
stehen bisher nur im Panel, nicht öffentlich. */}