import { useState } from "preact/hooks"; import { useTranslation } from "react-i18next"; import { Link } from "preact-router"; import { RiPictureInPictureExitFill, RiFullscreenFill } from "react-icons/ri"; import { IoCodeSlashSharp,IoChevronBackSharp,IoChevronForwardSharp, IoReloadSharp } from "react-icons/io5"; import { FaXmark } from "react-icons/fa6"; interface ProxyFrame extends HTMLElement { contentWindow: any; contentDocument: any; } export function IframeHeader(props: { url: string }) { const { t } = useTranslation(); const [showPopout, setShowPopout] = useState(false); const [showFullScreen, setFullScreen] = useState(false); if (showPopout) { window.location.replace(props.url); } if (showFullScreen) { document.getElementById("iframe").requestFullscreen(); setFullScreen(false); } return (

{" "} {t("header.title")}{" "}

{ const proxyFrame: ProxyFrame | null = document.getElementById("iframe") as ProxyFrame; proxyFrame.contentWindow.history.back(); }} /> { const proxyFrame: ProxyFrame | null = document.getElementById("iframe") as ProxyFrame; proxyFrame.contentWindow.location.reload(); }} /> { const proxyFrame: ProxyFrame | null = document.getElementById("iframe") as ProxyFrame; proxyFrame.contentWindow.history.forward(); }} />
); }