"use client"; import { useSession } from "next-auth/react"; import { useDispatchConnectionStore } from "../../../_store/connectionStore"; import { useRef, useState } from "react"; export const ConnectionBtn = () => { const modalRef = useRef(null); const connection = useDispatchConnectionStore((state) => state); const [form, setForm] = useState({ logoffTime: "", selectedZone: "LST_01", }); const session = useSession(); const uid = session.data?.user?.id; if (!uid) return null; return ( <> {!connection.isConnected ? ( ) : ( )}
{connection.isConnected ? (

Verbunden als{" "} <{connection.selectedZone}>

) : (

Als Disponent anmelden

)}
{!connection.isConnected && (

Du kannst diese Zeit später noch anpassen.

)}
{connection.isConnected ? ( ) : ( )}
); }; export const Connection = () => { return (
); };