import React, { memo, useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
import { useBreadcrumb } from '../../../layout/LayoutBreadcrumb';
import { Typography } from 'antd';

const { Text } = Typography;

const IndexErrorCode = memo(function IndexErrorCode() {
    const navigate = useNavigate();
    const { setBreadcrumbItems } = useBreadcrumb();

    useEffect(() => {
        const token = localStorage.getItem('token');
        if (token) {
            setBreadcrumbItems([
                { title: <Text strong style={{ fontSize: '14px' }}>• Master</Text> },
                { title: <Text strong style={{ fontSize: '14px' }}>Error Code</Text> }
            ]);
        } else {
            navigate('/signin');
        }
    }, []);

    return (
        <div>
            <h1>Error Code Page</h1>
        </div>
    );
});

export default IndexErrorCode;
