import type { ReactNode } from 'react' import { Link } from 'react-router-dom' import { BrandMark } from '../../components/BrandMark' import { Icon } from '../../components/Icon' import type { IconName } from '../../components/Icon' import { useInstanceFavicon } from '../../lib/usePublicConfig' import { useLegal } from '../../lib/useLegal' /** * Rama strony publicznej. * * Domyslnie WASKA (`max-w-2xl`): wiekszosc stron publicznych to jeden formularz * albo krotki komunikat, wygodniejszy na telefonie w waskiej kolumnie. * * `wide` przelacza na szerokosc panelu (`max-w-container`, 1200px) - dla stron, * ktore maja miescic wiecej tresci obok siebie i wygladac jak reszta serwisu: * strona zapisu na webinar oraz dokumenty prawne (regulamin, polityka). * Szerokosc ustawia layout, a nie poszczegolna strona - zgodnie z regula, ze * strona nie ustawia wlasnej szerokosci. */ export function PublicLayout({ children, wide = false }: { children: ReactNode; wide?: boolean }) { useInstanceFavicon() const legal = useLegal() const company = legal.data?.company // regulamin i polityka to gotowe dokumenty - sa zawsze dostepne, // wiec odnosniki pokazujemy bezwarunkowo (o ile dane w ogole sie zaladowaly) const ready = Boolean(legal.data) const widthClass = wide ? 'max-w-container' : 'max-w-2xl' return (
{children}
{/* Stopka prawna: uczestnik webinaru MUSI mieć dostęp do regulaminu, polityki prywatności i tożsamości administratora danych (RODO). Puste dokumenty nie pokazują odnośnika - odnośnik donikąd jest gorszy niż jego brak. */}
) } /** Komunikat zajmujacy cala strone, na przyklad brak miejsc albo webinar odwolany. */ export function PublicNotice({ icon, title, text, tone = 'neutral', children, }: { icon: IconName title: string text: string tone?: 'neutral' | 'success' | 'warning' children?: ReactNode }) { const tones = { neutral: 'border-slate-100 bg-white', success: 'border-ok-500/20 bg-ok-50', warning: 'border-warn-500/25 bg-warn-50', } const iconTones = { neutral: 'text-slate-300', success: 'text-ok-500', warning: 'text-warn-500', } const textTones = { neutral: 'text-slate-600', success: 'text-ok-600', warning: 'text-warn-600', } return (

{title}

{text}

{children &&
{children}
}
) }