import { jsx as _jsx } from "react/jsx-runtime";
import { useEditContext } from "../client/editContext";
import { SimpleTable } from "../ui/SimpleTable";
export function Sessions() {
    var editContext = useEditContext();
    if (!editContext)
        return null;
    const sessions = editContext?.activeSessions;
    const columns = [
        { body: (session) => session.user?.name, header: "User" },
        {
            body: (session) => (_jsx("a", { href: "#", onClick: () => {
                    if (session.item)
                        editContext?.loadItem(session.item);
                }, children: session.item?.name })),
            header: "Page",
        },
        {
            body: (session) => session.item?.language,
            header: "Language",
        },
        {
            body: (session) => session.item?.version,
            header: "Version",
        },
    ];
    return _jsx(SimpleTable, { items: sessions, columns: columns });
}
//# sourceMappingURL=Sessions.js.map