import React from 'react';
import Tag from '../tag';
import { SearchProps } from '../detailInterface';

export default function Detail(props: SearchProps) {
    const { value, componentAttr } = props;
    if (!value) return null;

    const { isMultiple } = componentAttr || {};
    const selfAttr = isMultiple ? { maxTagCount: 2 } : { maxTagCount: 1 };

    if (typeof value === 'object') {
        return <Tag value={value} {...selfAttr} />;
    }
}
