import { useState } from "react"; import { Box, Button, Grid, Slide, Snackbar, TextField, Typography, } from "@mui/material"; import { importProfile } from "../services/command"; const RulesPage = () => { const [url, setUrl] = useState(""); const [message, setMessage] = useState(""); const [disabled, setDisabled] = useState(false); const onClick = () => { if (!url) return; setUrl(""); setDisabled(true); importProfile(url) .then(() => setMessage("Successfully import profile.")) .catch(() => setMessage("Failed to import profile.")) .finally(() => setDisabled(false)); }; return ( Rules setUrl(e.target.value)} /> setMessage("")} message={message} TransitionComponent={(p) => } /> ); }; export default RulesPage;