mirror of
https://github.com/Sea-Haven-Industries/seahaven-ap.git
synced 2026-10-02 23:53:14 +00:00
Prove invoice coding and collaboration layout on mocks with a fixture PDF viewer, editable header/lines, Comments/Activity feeds, and role-aware action stubs via mock session switching.
19 lines
703 B
TypeScript
19 lines
703 B
TypeScript
import { useMemo, useState, type ReactNode } from "react";
|
|
import { getMockSessionUser, setMockSessionUserId, type MockUser } from "@/mocks";
|
|
import { MockSessionContext, type MockSessionContextValue } from "@/providers/mock-session-context";
|
|
|
|
export function MockSessionProvider({ children }: { children: ReactNode }) {
|
|
const [user, setUser] = useState<MockUser>(() => getMockSessionUser());
|
|
|
|
const value = useMemo<MockSessionContextValue>(
|
|
() => ({
|
|
user,
|
|
setCurrentUserId: (nextUserId: string) => {
|
|
setUser(setMockSessionUserId(nextUserId));
|
|
},
|
|
}),
|
|
[user],
|
|
);
|
|
|
|
return <MockSessionContext.Provider value={value}>{children}</MockSessionContext.Provider>;
|
|
}
|