import { createState } from '@hookstate/core' import React from 'react' import { Entity } from '../../ecs/classes/Entity' import { createXRUI } from '../../xrui/functions/createXRUI' import { useXRUIState } from '../../xrui/functions/useXRUIState' export interface InteractiveModalState { interactMessage: string } export const createInteractiveModalView = (entity: Entity, interactMessage: string) => { const ui = createXRUI( InteractiveModalView, createState({ interactMessage } as InteractiveModalState) ) return ui } export const InteractiveModalView = () => { const modalState = useXRUIState() return (
{modalState.interactMessage.value}
) }