diff options
Diffstat (limited to 'components/tag.tsx')
-rw-r--r-- | components/tag.tsx | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/components/tag.tsx b/components/tag.tsx index 477b8e2..048c405 100644 --- a/components/tag.tsx +++ b/components/tag.tsx @@ -3,22 +3,26 @@ import { CSSProperties } from 'react'; export default function Tags(props: { tags: Array<string>; }) { - return <div className="tags"> + return <div className='tags'> <span>Tags:</span> - {props.tags.map(tag => <Tag key={Math.random().toString()} name={tag}/>)} - </div> + {props.tags.map(tag => <Tag key={Math.random().toString()} name={tag} />)} + </div>; } export function Tag(props: { name: string; }) { - return <a className="tag" href={"/search?q=" + props.name} style={{ - "--tag-hue": props.name - .split("") - .map(char => char.charCodeAt(0)) - .reduce((a, b) => a + b) - % 360 - } as CSSProperties}> + return <a + className='tag' + href={'/search?q=' + props.name} + style={{ + '--tag-hue': props.name + .split('') + .map(char => char.charCodeAt(0)) + .reduce((a, b) => a + b) + % 360, + } as CSSProperties} + > {props.name} - </a> + </a>; } |