Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

644 B
Raw Blame
import { useMemo, useState, type ReactNode } from 'react';

import { ComposerBridgeContext, type ComposerInsertTarget } from './ComposerBridgeContext';

export const ComposerBridgeProvider = ({ children }: { children: ReactNode }) => {
  const [target, setTarget] = useState<ComposerInsertTarget | null>(null);
  // Stable value identity (setTarget is a stable setState fn) so the value only
  // changes when the active composer target does — not on unrelated re-renders.
  const value = useMemo(() => ({ target, setTarget }), [target]);
  return <ComposerBridgeContext.Provider value={value}>{children}</ComposerBridgeContext.Provider>;
};