refactor(characters): drive shared UI from active character
This commit is contained in:
@@ -4,8 +4,6 @@ import type { Dispatch, ReactNode } from "react";
|
||||
import { createActorContext, shallowEqual } from "@xstate/react";
|
||||
import type { SnapshotFrom } from "xstate";
|
||||
|
||||
import { DEFAULT_CHARACTER_ID } from "@/data/constants/character";
|
||||
|
||||
import { privateRoomMachine } from "./private-room-machine";
|
||||
import type {
|
||||
PrivateRoomEvent,
|
||||
@@ -34,12 +32,12 @@ const PrivateRoomActorContext = createActorContext(privateRoomMachine);
|
||||
|
||||
export interface PrivateRoomProviderProps {
|
||||
children: ReactNode;
|
||||
characterId?: string;
|
||||
characterId: string;
|
||||
}
|
||||
|
||||
export function PrivateRoomProvider({
|
||||
children,
|
||||
characterId = DEFAULT_CHARACTER_ID,
|
||||
characterId,
|
||||
}: PrivateRoomProviderProps) {
|
||||
return (
|
||||
<PrivateRoomActorContext.Provider options={{ input: { characterId } }}>
|
||||
|
||||
Reference in New Issue
Block a user