RelaySelector should not accept any props

This commit is contained in:
Alex Gleason committed 2025-06-04 18:32:45 -05:00
1 parent 61508020ae
commit da87f2c7b1
3 files changed
+39 -12

No files matched your search

+8 -4
View File
@@ -15,16 +15,20 @@ import {
PopoverTrigger,
} from "@/components/ui/popover";
import { useState } from "react";
import { useAppContext } from "@/hooks/useAppContext";
interface RelaySelectorProps {
className?: string;
selectedRelay?: string;
setSelectedRelay: (relay: string) => void;
presetRelays?: { name: string; url: string }[];
}
export function RelaySelector(props: RelaySelectorProps) {
const { selectedRelay, setSelectedRelay, className, presetRelays = [] } = props;
const { className } = props;
const { config, updateConfig, presetRelays = [] } = useAppContext();
const selectedRelay = config.relayUrl;
const setSelectedRelay = (relay: string) => {
updateConfig((current) => ({ ...current, relayUrl: relay }));
};
const [open, setOpen] = useState(false);
const [inputValue, setInputValue] = useState("");