import { AssistantState } from "./types/client.js";
import { FC, PropsWithChildren } from "react";

//#region src/AuiIf.d.ts
declare namespace AuiIf {
  /** Props for `AuiIf`. */
  type Props = PropsWithChildren<{
    /**
     * Selector that decides whether to render `children`. Children render
     * when this returns `true` and unmount when it returns `false`.
     */
    condition: AuiIf.Condition;
  }>;
  /**
   * Selector passed to `AuiIf`. Receives the assistant state and must
   * return a boolean.
   */
  type Condition = (state: AssistantState) => boolean;
}
/**
 * Conditionally renders children based on a slice of assistant state.
 *
 * A thin wrapper around {@link useAuiState} that renders its children
 * when `condition` returns `true` and unmounts them when it returns
 * `false`. Keeps render logic declarative without mounting unused
 * subtrees.
 *
 * @example
 * ```tsx
 * <AuiIf condition={(s) => s.thread.isRunning}>
 *   <CancelButton />
 * </AuiIf>
 * ```
 *
 * @example
 * ```tsx
 * <AuiIf condition={(s) => s.thread.messages.length === 0}>
 *   <EmptyState />
 * </AuiIf>
 * ```
 */
declare const AuiIf: FC<AuiIf.Props>;
//#endregion
export { AuiIf };
//# sourceMappingURL=AuiIf.d.ts.map