import { ReactNode } from 'react';
import { HStack, Text } from 'native-base';

type GeneralInfoRowProps = { label: string; value: string | ReactNode };

const GeneralInfoRow = ({ label, value }: GeneralInfoRowProps) => (
  <HStack className="flex-wrap items-center">
    <Text className="text-base font-bold">{`${label}:  `}</Text>
    {typeof value === 'string' ? (
      <Text numberOfLines={2} className="text-base font-normal">
        {value}
      </Text>
    ) : (
      value
    )}
  </HStack>
);

export default GeneralInfoRow;
