import {html} from "lit"
import {view} from "@e280/sly"
import {Id} from "../../../tools/id.js"
import {LobbyView} from "../lobby/view.js"
import * as Sparrow from "../../../browser/index.js"
import {HostingSituation} from "../../logic/situations/hosting.js"
import stylesCss from "./styles.css.js"
import themeCss from "../../theme.css.js"
import crownSvg from "../../icons/tabler/crown.svg.js"
import chartBarPopularSvg from "../../icons/tabler/chart-bar-popular.svg.js"
export const HostView = view(use => (situation: HostingSituation) => {
use.styles(themeCss, stylesCss)
const stats = situation.stats.value
const {invite} = situation.hosted
const {id, reputation} = situation.hosted.self
return html`
Connected to signaller
${situation.url}
Signaller Stats
${chartBarPopularSvg}
-
Hosting now
${stats.agents}
-
Daily connections
${stats.daily.connections}
-
Daily failures
${stats.daily.failures}
${LobbyView(id, situation.lobby.value, id => situation.killUser(id))}
`
})