import React, { Component } from 'react'; import './index.less'; export default class HardInput extends Component { render() { const { focus, answer = [], show, list = [], correct, onClick, onDelete } = this.props; const a = answer.length > 0 ? answer[0] : []; const otherList = []; if (show) { const map = {}; list.forEach((row) => { map[row.uuid] = row; }); a.forEach((row) => { if (!map[row.uuid]) otherList.push(row); }); } return (
{ if (onClick) onClick(); }}> {list.map((item) => { return (
= 0 || correct ? 'true' : 'false'} ${show ? 'show' : ''}`} onClick={() => { if (onDelete) onDelete(item); }}>
{item.text}
); })} {otherList.map(item => { return (
{item.text}
); })}
); } }