# give/4.16.9/src/Views/Components/Label/index.js

GiveWP – Donation Plugin and Fundraising Platform, version 4.16.9. 21 lines.

- Page: https://pluginprobe.com/plugins/give/4.16.9/code/src/Views/Components/Label/index.js
- Raw: https://pluginprobe.com/plugins/give/4.16.9/raw/src/Views/Components/Label/index.js
- Modified: 2025-05-21T20:18:30+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.16.9/code/src/Views/Components/Label/index.js#L10-L20`.

```javascript
import classNames from 'classnames';
import styles from './styles.module.scss';

const Label = ({type, text}) => {
    const labelClasses = classNames(
        styles.label,
        {[styles.error]: type === 'error' || type === 'failed'},
        {[styles.warning]: type === 'warning' || type === 'incomplete' || type === 'reversed'},
        {[styles.notice]: type === 'notice'},
        {[styles.success]: type === 'success'},
        {[styles.info]: type === 'info' || type === 'running'},
        {[styles.http]: type.toUpperCase() === 'HTTP'}
    );

    const labelText = text && text.length > 0 ? text : type.charAt(0).toUpperCase() + type.slice(1);

    return <div className={labelClasses}>{labelText}</div>;
};

export default Label;

```
