2024-08-16 21:17:50 -05:00
|
|
|
import { InfoCircledIcon } from '@radix-ui/react-icons';
|
|
|
|
|
import { Callout, Flex, Heading, Link } from '@radix-ui/themes';
|
2024-06-12 13:08:52 -05:00
|
|
|
import { use } from 'react';
|
|
|
|
|
import PageWrapper from '../../../../../components/PageWrapper';
|
2024-08-25 18:10:56 -05:00
|
|
|
import { reviews } from '../../../../../core/blitzkit/reviews';
|
2024-07-09 20:35:36 -05:00
|
|
|
import * as Duel from '../../../../../stores/duel';
|
2024-06-12 13:08:52 -05:00
|
|
|
|
|
|
|
|
export function VideoSection() {
|
2024-07-10 13:11:09 -05:00
|
|
|
const tank = Duel.use((state) => state.protagonist.tank);
|
2024-08-25 18:10:56 -05:00
|
|
|
const awaitedReviews = use(reviews);
|
|
|
|
|
const videos = awaitedReviews.reviews[tank.id]?.videos;
|
|
|
|
|
|
|
|
|
|
if (!videos) return null;
|
2024-06-12 13:08:52 -05:00
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<PageWrapper noFlex1>
|
2024-08-16 21:17:50 -05:00
|
|
|
<Flex direction="column" gap="6" align="center">
|
|
|
|
|
<Flex direction="column" gap="2" align="center">
|
2024-06-12 13:08:52 -05:00
|
|
|
<Heading size="6">Review videos</Heading>
|
2024-08-16 21:17:50 -05:00
|
|
|
|
|
|
|
|
<Callout.Root size="1">
|
|
|
|
|
<Callout.Icon>
|
|
|
|
|
<InfoCircledIcon />
|
|
|
|
|
</Callout.Icon>
|
|
|
|
|
<Callout.Text>
|
|
|
|
|
BlitzKit does not endorse any review videos.
|
|
|
|
|
</Callout.Text>
|
|
|
|
|
</Callout.Root>
|
2024-06-12 13:08:52 -05:00
|
|
|
</Flex>
|
|
|
|
|
|
|
|
|
|
<Flex gap="3" wrap="wrap">
|
|
|
|
|
{videos.map((video) => (
|
|
|
|
|
<Link
|
2024-08-25 18:10:56 -05:00
|
|
|
key={video.id}
|
|
|
|
|
href={`https://www.youtube.com/watch?v=${video.id}`}
|
2024-06-12 13:08:52 -05:00
|
|
|
target="_blank"
|
|
|
|
|
>
|
|
|
|
|
<img
|
|
|
|
|
alt="Video thumbnail"
|
2024-08-25 18:10:56 -05:00
|
|
|
src={`https://i.ytimg.com/vi/${video.id}/hqdefault.jpg`}
|
2024-06-12 13:08:52 -05:00
|
|
|
style={{
|
|
|
|
|
aspectRatio: '16 / 9',
|
|
|
|
|
objectFit: 'cover',
|
|
|
|
|
height: 128,
|
|
|
|
|
borderRadius: 8,
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Link>
|
|
|
|
|
))}
|
|
|
|
|
</Flex>
|
|
|
|
|
</Flex>
|
|
|
|
|
</PageWrapper>
|
|
|
|
|
);
|
|
|
|
|
}
|