import React from 'react';
import { Card, Table } from '@theorchard/suite-components';
import { useIdentity } from '@theorchard/suite-identity';
import { YesNoValue } from './booleanValue';

export const AccountRights = () => {
    const identity = useIdentity();

    return (
        <Card className="AccountRights">
            <Card.Header>Rights</Card.Header>
            <Card.Body>
                <Table bordered={false} size="sm">
                    <tbody>
                        <tr>
                            <td>Roles</td>
                            <td>{identity.roles?.join(',') || '-'}</td>
                        </tr>
                        <tr>
                            <td>Is employee</td>
                            <td>
                                <YesNoValue value={identity.isEmployee} />
                            </td>
                        </tr>
                    </tbody>
                </Table>
            </Card.Body>
        </Card>
    );
};
