/**
 * Copyright 2024 Phenix Real Time Solutions, Inc. Confidential and Proprietary. All Rights Reserved.
 */
import {JSX} from 'react';
import {RestrictedRowLabel, RestrictedRowText, RestrictedRowWrapper} from './style';

import {RestrictedText} from '.';

interface IRestrictedTextWithLabel {
  label: string;
  text: string;
  isLink?: boolean;
  linkClassName?: string;
  labelIcon?: JSX.Element;
}

const RestrictedTextWithLabel = ({
  label,
  text,
  labelIcon,
  isLink = false,
  linkClassName = ''
}: IRestrictedTextWithLabel): JSX.Element => {
  return (
    <RestrictedRowWrapper>
      <RestrictedRowLabel>{label} {labelIcon}</RestrictedRowLabel>
      <RestrictedRowText>
        <RestrictedText text={text} isLink={isLink} linkClassName={linkClassName} />
      </RestrictedRowText>
    </RestrictedRowWrapper>
  );
};

export default RestrictedTextWithLabel;