// Copyright (c) Cratis. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. import { lazy, useId, useState, useSyncExternalStore } from 'react'; import { RegisteredComponentProps } from '@cratis/scene.react'; import { ArcRuntimeBoundary, BindingKind, BoundConstructor, MissingBinding, resolveExactQuery, subscribeQueryBindings } from '../bindings'; import { stringProperty } from '../properties'; import { SingleResultStatus } from '../data/SingleResultStatus'; import { QueryInput, queryInputError, queryInputs } from './queryInputs'; const SingleResultRuntime = lazy(() => import('../data/SingleResultRuntime')); /** Opt-in, form-local string drafts around the existing optional-single execution owner. */ export function SceneQueryInputForm({ element }: RegisteredComponentProps) { const name = stringProperty(element.properties, 'query'); const target = useSyncExternalStore(subscribeQueryBindings, () => name ? resolveExactQuery(name) : undefined); if (target === 'ambiguous') return