superdesk/superdesk-client-core

View on GitHub
scripts/apps/contacts/components/fields/State.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import React from 'react';
import PropTypes from 'prop-types';
import {gettext} from 'core/utils';

export const State: React.StatelessComponent<any> = ({item}) => {
    const cssClass = item.contact_state ? 'state-label' : null;

    return (
        <div key="state" className={cssClass}>
            {
                item.contact_state !== undefined && item.contact_state !== null && (
                    <span title={item.contact_state}>
                        {gettext(item.contact_state)}
                    </span>
                )
            }
        </div>
    );
};

State.propTypes = {
    item: PropTypes.object,
};