import { TextField } from "@mui/material";
import { useAtom } from "jotai";
import { serverConnectionAtom, serverUrlAtom } from "../../lib/jotai";

export const ServerUrlInput = () => {
  // atoms
  const [serverUrl, setServerUrl] = useAtom(serverUrlAtom);

  return (
    <TextField
      fullWidth
      label='Backend server URL'
      onChange={(event) => setServerUrl(event.target.value)}
      size='small'
      value={serverUrl}
    />
  );
};
