import React, { useState, useEffect, memo } from 'react'; import { useNavigate } from 'react-router-dom'; import { Button, Typography } from 'antd'; import { resetWA } from '../../api/web-control'; import { useBreadcrumb } from '../../layout/LayoutBreadcrumb'; import { ReloadOutlined } from '@ant-design/icons'; const { Text } = Typography; const IndexWebControl = memo(function IndexWebControl() { const navigate = useNavigate(); const { setBreadcrumbItems } = useBreadcrumb(); const [isPlaying, setIsPlaying] = useState(true); const url = "http://localhost:9531/qrview"; const handleReset = async() => { setIsPlaying(false); await resetWA(); setIsPlaying(true); }; useEffect(() => { const token = localStorage.getItem('token'); if (token) { setBreadcrumbItems([ { title: ( • Web Control Panel ), }, ]); } else { navigate('/signin'); } }, []); return (
{isPlaying ? (