Skip to content

A desktop coding agent with free access to frontier models.

TypeScript
2.2 KB
Raw Blame
/** @jsxImportSource react */
import {
  Page,
  PageBackground,
  PageDescription,
  PageHeader,
  PageTitle,
  PageTitlebarRegion,
} from "@/components/page";
import { Button } from "@/components/ui/button";
import { useProviderLock } from "@/app/lib/provider-lock";
import { KeyRoundIcon, SkipForwardIcon } from "lucide-react";

type ProviderSelectionStepProps = {
  onBringYourOwn: () => void;
  onSkip: () => void;
};

export function ProviderSelectionStep({
  onBringYourOwn,
  onSkip,
}: ProviderSelectionStepProps) {
  // While the server locks model providers (app/lib/provider-lock.ts) there is no key to bring.
  const providerLock = useProviderLock();
  return (
    <div className="fixed inset-0 z-50 flex items-center justify-center bg-background">
      <PageBackground />
      <PageTitlebarRegion />

      <div className="relative z-10 mx-6 w-full max-w-md rounded-3xl border border-border bg-background px-8 py-10">
        <PageHeader className="mb-8 text-center">
          <PageTitle>Power your first task</PageTitle>
          <PageDescription>
            Connect a model, then try a real task in chat so you can see omnirush.ai work.
          </PageDescription>
        </PageHeader>

        <div className="space-y-3">
          {providerLock.locked ? null : <button
            type="button"
            className="flex w-full items-start gap-4 rounded-xl border border-border bg-card p-4 text-left transition-colors hover:bg-accent"
            onClick={onBringYourOwn}
          >
            <KeyRoundIcon className="mt-0.5 size-5 shrink-0 text-muted-foreground" />
            <div>
              <div className="text-sm font-medium text-foreground">
                Bring your own API key
              </div>
              <div className="mt-0.5 text-xs text-muted-foreground">
                Connect OpenAI, Anthropic, Google, or another provider, then run your first task.
              </div>
            </div>
          </button>}

          <div className="pt-1 text-center">
            <Button variant="ghost" size="sm" onClick={onSkip}>
              <SkipForwardIcon className="mr-1.5 size-3.5" />
              Skip and use the free model
            </Button>
          </div>
        </div>
      </div>
    </div>
  );
}