MCPcopy
hub / github.com/codeaashu/claude-code / RemoteEnvironmentDialog

Function RemoteEnvironmentDialog

src/components/RemoteEnvironmentDialog.tsx:26–192  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

24};
25type LoadingState = 'loading' | 'updating' | null;
26export function RemoteEnvironmentDialog(t0) {
27 const $ = _c(27);
28 const {
29 onDone
30 } = t0;
31 const [loadingState, setLoadingState] = useState("loading");
32 let t1;
33 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
34 t1 = [];
35 $[0] = t1;
36 } else {
37 t1 = $[0];
38 }
39 const [environments, setEnvironments] = useState(t1);
40 const [selectedEnvironment, setSelectedEnvironment] = useState(null);
41 const [selectedEnvironmentSource, setSelectedEnvironmentSource] = useState(null);
42 const [error, setError] = useState(null);
43 let t2;
44 let t3;
45 if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
46 t2 = () => {
47 let cancelled = false;
48 const fetchInfo = async function fetchInfo() {
49 ;
50 try {
51 const result = await getEnvironmentSelectionInfo();
52 if (cancelled) {
53 return;
54 }
55 setEnvironments(result.availableEnvironments);
56 setSelectedEnvironment(result.selectedEnvironment);
57 setSelectedEnvironmentSource(result.selectedEnvironmentSource);
58 setLoadingState(null);
59 } catch (t4) {
60 const err = t4;
61 if (cancelled) {
62 return;
63 }
64 const fetchError = toError(err);
65 logError(fetchError);
66 setError(fetchError.message);
67 setLoadingState(null);
68 }
69 };
70 fetchInfo();
71 return () => {
72 cancelled = true;
73 };
74 };
75 t3 = [];
76 $[1] = t2;
77 $[2] = t3;
78 } else {
79 t2 = $[1];
80 t3 = $[2];
81 }
82 useEffect(t2, t3);
83 let t4;

Callers

nothing calls this directly

Calls 3

fetchInfoFunction · 0.85
updateSettingsForSourceFunction · 0.85
onDoneFunction · 0.50

Tested by

no test coverage detected