/**
 * Toast item component
 * @constructor ApToastItem
 */
"use strict";

import React, {PropTypes as types} from 'react';
import classnames from 'classnames';
import {ApIcon} from 'apeman-react-icon';
import {ApTouchMixin} from 'apeman-react-mixins';


/** @lends ApToastItem */
let ApToastItem = React.createClass({
    //--------------------
    // Specs
    //--------------------

    propTypes: {
        text: types.string,
        icon: types.string
    },

    mixins: [
        ApTouchMixin
    ],

    render(){
        let s = this,
            {props} = s;
        return (
            <div className="ap-toast-item" data-text={props.text}>
                <ApIcon className={classnames('ap-toast-item-icon', props.icon)}/>
                <span className="ap-toast-text">{props.text}</span>
                {props.children}
            </div>
        );
    }
});

module.exports = ApToastItem;