gdq-archive/frontend/components/Runner.tsx

44 lines
1.7 KiB
TypeScript
Raw Normal View History

2023-01-09 03:02:23 +00:00
import {
faFacebook, faTwitch, faTwitter, faYoutube,
} from '@fortawesome/free-brands-svg-icons';
2023-01-08 10:07:44 +00:00
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import * as React from 'react';
import { RunnerInformation } from 'util/datatypes/RunnerList';
import style from './Runner.module.scss';
export default function Runner({ runner }: { runner: RunnerInformation }) {
return (
<span className="mr-3 text-nowrap">
<span className="mr-1">{runner.name}</span>
<sup>
2023-01-09 01:33:50 +00:00
{runner.platform === 'TWITCH' && runner.stream.length > 0 ? (
<a href={runner.stream}>
2023-01-09 03:02:23 +00:00
<FontAwesomeIcon icon={faTwitch} className={['mr-1', style.twitch].join(' ')} />
2023-01-09 01:33:50 +00:00
</a>
) : ''}
{runner.platform === 'FACEBOOK' && runner.stream.length > 0 ? (
<a href={runner.stream}>
2023-01-09 03:02:23 +00:00
<FontAwesomeIcon icon={faFacebook} className={['mr-1', style.facebook].join(' ')} />
2023-01-09 01:33:50 +00:00
</a>
) : ''}
{runner.platform === 'YOUTUBE' && runner.stream.length > 0 ? (
<a href={runner.stream}>
2023-01-09 03:02:23 +00:00
<FontAwesomeIcon icon={faYoutube} className={['mr-1', style.youtube].join(' ')} />
2023-01-09 01:33:50 +00:00
</a>
) : ''}
{runner.twitter && runner.twitter.length > 0 ? (
<a href={`https://twitter.com/${runner.twitter}`}>
2023-01-09 03:02:23 +00:00
<FontAwesomeIcon icon={faTwitter} className={['mr-1', style.twitter].join(' ')} />
2023-01-09 01:33:50 +00:00
</a>
) : ''}
{runner.youtube && runner.youtube.length > 0 ? (
<a href={`https://youtube.com/${runner.youtube}`}>
2023-01-09 03:02:23 +00:00
<FontAwesomeIcon icon={faYoutube} className={['mr-1', style.youtube].join(' ')} />
2023-01-09 01:33:50 +00:00
</a>
) : ''}
2023-01-08 10:07:44 +00:00
</sup>
</span>
2023-01-09 01:33:50 +00:00
);
2023-01-08 10:07:44 +00:00
}