/**
 * `<Autocomplete.Value>` — displays the current input value (the
 * autocomplete's source of truth). Render-function children receive
 * `(value: string)` matching React's `AutocompleteValue`.
 */

import { createMemo } from "solid-js";
import { useComboboxRootContext } from "../../combobox/root/combobox-root-context.jsx";
export function AutocompleteValue(props) {
  const root = useComboboxRootContext();
  const resolved = createMemo(() => {
    const value = String(root.inputValue());
    if (typeof props.children === "function") {
      return props.children(value);
    }
    if (props.children != null) return props.children;
    return value;
  });
  return <>{resolved()}</>;
}
//# sourceMappingURL=autocomplete-value.jsx.map
