import React, { useState, useEffect } from "react"; import { toast } from 'react-toastify'; import ReactGA from 'react-ga4'; import theme from "../theme.jsx"; import { useNavigate, Link } from "react-router-dom"; import { Paper, Typography, Divider, Button, Grid, Card, } from "@mui/material"; // import magic wand icon from material ui icons import { AutoFixHigh as AutoFixHighIcon, ArrowForward as ArrowForwardIcon, } from '@mui/icons-material'; //import { useAlert const Priority = (props) => { const { globalUrl, userdata, serverside, priority, checkLogin, setAdminTab, setCurTab, } = props; const isCloud = window.location.host === "localhost:3002" || window.location.host === "shuffler.io"; let navigate = useNavigate(); const changeRecommendation = (recommendation, action) => { const data = { action: action, name: recommendation.name, }; fetch(`${globalUrl}/api/v1/recommendations/modify`, { mode: "cors", method: "POST", body: JSON.stringify(data), credentials: "include", crossDomain: true, withCredentials: true, headers: { "Content-Type": "application/json; charset=utf-8", }, }) .then((response) => { if (response.status === 200) { } else { } return response.json(); }) .then((responseJson) => { if (responseJson.success === true) { if (checkLogin !== undefined) { checkLogin() } } else { if (responseJson.success === false && responseJson.reason !== undefined) { toast("Failed change recommendation: ", responseJson.reason) } else { toast("Failed change recommendation"); } } }) .catch((error) => { toast("Failed dismissing alert. Please contact support@shuffler.io if this persists."); }); } return (