/* TargiApp — root: routing logowanie → app, header, przełączanie widoków */
function Header({ view, setView, user }) {
const store = useStore();
return (
EPS
TargiApp
{store.state.fair.name}
{store.fullName(user)}
{user.isAdmin ? "Administrator" : "Pracownik"}
{user.isAdmin ? (
) : null}
);
}
function App() {
const store = useStore();
const [view, setView] = useState("harmonogram");
const user = store.currentUser();
if (!user) return ;
if (store.state.ready === false) return (
);
const activeView = view === "uzytkownicy" && !user.isAdmin ? "harmonogram" : view;
return (
{activeView === "uzytkownicy" ?
: activeView === "opinie" ?
:
}
);
}
ReactDOM.createRoot(document.getElementById("root")).render();