Dejvino's Curriculum Vitae
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

25 rivejä
843 B

  1. import React from 'react';
  2. import Container from 'react-bootstrap/Container';
  3. import { useAutoFocus } from '../hooks/FocusedElement';
  4. import Tag from './Tag';
  5. export type Props = {
  6. title: string,
  7. icon?: string,
  8. tags: string[],
  9. style?: 'primary' | 'light'
  10. }
  11. export default function TagCloud(props: Props) {
  12. const focusRef = useAutoFocus<HTMLDivElement>('tags ' + props.title)
  13. const containerClasses = ['tag-cloud', 'cloud-' + (props.style || 'standard')]
  14. return (
  15. <Container ref={focusRef} className={containerClasses.join(' ')}>
  16. <h4>{props.icon && (<i className={'bi-' + props.icon}> </i>)}{props.title}</h4>
  17. <Container className='tag-badges'>
  18. {props.tags.map((tag: string) => (<Tag key={tag} text={tag} />) )}
  19. </Container>
  20. </Container>
  21. )
  22. }