import React from 'react';

interface TokenPayload {
    unique_name: string;
    exp: number;
    [key: string]: any;
}

interface HomeProps {
    tokenPayload: TokenPayload | null;
}

const Home: React.FC<HomeProps> = ({ tokenPayload }) => {
    return (
        <div className="home">
            <h2>Welcome, {tokenPayload?.unique_name ? tokenPayload.unique_name : 'Unknown'}</h2>
            <p>
                Token expires at: {tokenPayload?.exp ? new Date(tokenPayload.exp * 1000).toLocaleString() : 'Unknown'}
            </p>
        </div>
    );
};

export default Home;
