import React from 'react';
import styles from './index.less';
import { LinkProps } from '../detailInterface';

export default function Detail(props: LinkProps) {
    const { value } = props;
    if (!value) return null;
    if (Array.isArray(value)) {
        return (
            <div className={styles.text}>
                {value.map((item, i) => {
                    return (
                        <div key={i}>
                            <a target="_blank" href={item.value} style={{ textDecoration: 'underline' }}>
                                {item.text || item.value}
                            </a>
                        </div>
                    );
                })}
            </div>
        );
    }
}
