npm.io
5.4.4 • Published 6 years ago

@comparaonline/ui-offer-empty

Licence
MIT
Version
5.4.4
Deps
0
Size
22 kB
Vulns
0
Weekly
0

ui-offer-empty

Installation

yarn add @comparaonline/ui-offer-empty

##Usage

import { Empty } from '@comparaonline/ui-offer-empty';
Prop required type Description
texts false ITextsProps [...] Text Object

Implementation

import React, { useState } from 'react';
import { Empty } from '@comparaonline/ui-offer-empty';

const Results = () => {
    const [results, setResults] = useState([]);

    if (!Boolean(results.length)) {
        return <Empty texts={{ paragraph: 'My first paragraph', phone: 'some phone if exists, +5695674321', resume: 'a short description for phone maybe', whatsapp: { url: 'whatsapp url', message: 'the whatsapp message', description: 'the short description for whatsapp' } }} />
    }

    render() {
        return (
            <Grid>
                {results.map(result => <Result result={result} />)}
            </Grid>
        );
    }
}
Types
import { IEmptyProps, ITextsProps } from '@comparaonline/ui-offer-empty';

interface MyOwnProps {
  mytexts: ITextsProps;
}

interface MyOwnExtendedProps extends IEmptyProps {
  onemore: boolean;
}

Happy coding