import type { FC, ReactElement } from 'react';
import React from 'react';
import { useIdentity } from '@theorchard/suite-frontend';
import { ABACUS_PROFILE } from 'src/constants';

interface Props {
    children?: ReactElement;
}

const RestrictedByAbacusProfileWrapper: FC<Props> = ({ children }) => {
    const { profileType } = useIdentity();

    if (profileType !== ABACUS_PROFILE) return null;

    return <>{children}</>;
};

export default RestrictedByAbacusProfileWrapper;
