import React from 'react';
import Container from 'react-bootstrap/Container';
import Tag from './Tag';

export type Props = {
    title: string,
    icon?: string,
    tags: string[],
    style?: 'primary' | 'light'
}

export default function TagCloud(props: Props) {
    const containerClasses = ['tag-cloud', 'cloud-' + (props.style || 'standard')]
    return (
        <Container className={containerClasses.join(' ')} fluid>
            <h4>{props.icon && (<i className={'bi-' + props.icon}> </i>)}{props.title}</h4>
            <Container className='tag-badges' fluid>
                {props.tags.map((tag: string) => (<Tag key={tag} text={tag} />) )}
            </Container>
        </Container>
    )
}
