from __future__ import annotations from collections.abc import Mapping import htpy as h from htpy import Renderable from repub.components import publisher_shell from repub.pages.dashboard import published_feeds_table from repub.pages.runs import live_work_section, relative_time_formatter_script def publisher_page( *, current_path: str, source_feeds: tuple[Mapping[str, object], ...] | None = None, running_executions: tuple[Mapping[str, object], ...] | None = None, queued_executions: tuple[Mapping[str, object], ...] | None = None, reader_app_url: str | None = None, ) -> Renderable: return publisher_shell( current_path=current_path, content=( h.section[ h.div( class_="flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between" )[ h.div[ h.p( class_="text-xs font-semibold uppercase tracking-[0.22em] text-amber-600" )["Republisher"], h.h1( class_="mt-1 text-3xl font-semibold tracking-tight text-slate-950" )["Published feeds"], ], reader_app_url and h.a( href=reader_app_url, target="_blank", rel="noopener noreferrer", class_="inline-flex shrink-0 items-center justify-center rounded-full bg-amber-400 px-4 py-2.5 text-sm font-semibold text-slate-950 transition hover:bg-amber-300", )["Open AnyNews"], ], ], published_feeds_table( source_feeds=source_feeds, manage_sources_href=None, show_heading=False, show_feed_url=False, compact_mobile=True, ), live_work_section( running_executions=running_executions, queued_executions=queued_executions, show_row_actions=False, compact_mobile=True, ), relative_time_formatter_script(), ), )