import React from 'react';
import SingleTag  from '../SingleTag';
import './index.less';

export default function TagView({ tags, onSelect }) {
  return (
    <div className="tag-label-view">
      {tags.length > 0 ? (
        tags.map(item => <SingleTag key={item.code} item={item} isActive={true} onSelect={onSelect} style={{ cursor: onSelect ? 'pointer' : 'unset', margin: '8px 8px 8px 0' }} />)
      ) : (
        <div className="no-label">暂无标签</div>
      )}
    </div>
  );
}
