All files Tab.jsx

100% Statements 2/2
100% Branches 2/2
100% Functions 2/2
100% Lines 2/2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28          3x                               3x            
import React, { Component } from 'react';
import PropTypes from 'prop-types';
 
export default class Tab extends Component {
    constructor(props) {
        super(props);
    }
 
    static propTypes = {
        isActive: PropTypes.bool,
        label: PropTypes.string,
        url: PropTypes.string
    }
 
    static defaultProps = {
        isActive: false,
        label: "",
        url: "javascript:;"
    }
 
    render() {
        return (
            <li className="tab">
                <a className={this.props.isActive ? "active" : ""} href={this.props.url} onClick={this.props.onClick}>{this.props.label}</a>
            </li>
        );
    }
};