import React, { Component } from 'react';
import './style.styl';

class FAQ extends Component<any> {
    render() {
        const { data } = this.props;
        return (
            <div className="faq" id="faq">
                <div className="faq-head">常见问题</div>
                <div className="faq-main">
                    {data.map((item: any, index: number) => {
                        return (
                            <React.Fragment key={index}>
                                {index == 0 ? null : (
                                    <div className="split-line" />
                                )}
                                <div className="faq-main-qa">
                                    <div className="qus">
                                        {item.ask ? <span>Q: </span> : ''}
                                        <div>{item.ask}</div>
                                    </div>
                                    <div className="as">
                                        {item.answer ? <span>A: </span> : ''}
                                        <div>{item.answer} </div>
                                    </div>
                                </div>
                            </React.Fragment>
                        );
                    })}
                </div>
            </div>
        );
    }
}

export default FAQ;
