"use client";
import { useRouter } from "next/navigation";
import { Select } from "@unlocalhosted/metalui";
import { BranchIcon, RepoIcon } from "@/components/icons";
type Side = { baseRepo: string; base: string; headRepo: string; head: string | null };
/**
* The two sides of a comparison: where the changes go (base) and where they come from (head). With
* forks around, each side also names its repository ("owner/name"), and the page belongs to the base's.
*/
export function CompareSelect({ branches, headBranches, repos, current }: { branches: string[]; headBranches: string[]; repos: string[]; current: Side }) {
const router = useRouter();
const options = (names: string[]) => names.map((b) => ({ value: b, label: b, lead: