Files
blitzkit/packages/website/src/components/Plugs.tsx
T

50 lines
1.2 KiB
TypeScript
Raw Normal View History

2024-10-18 10:29:58 -05:00
import { assertSecret } from '@blitzkit/core';
2024-09-01 20:53:44 -05:00
import { ArrowRightIcon } from '@radix-ui/react-icons';
2024-10-18 10:29:58 -05:00
import { Button, Code, Flex, Link, Text } from '@radix-ui/themes';
2024-10-09 21:04:49 -05:00
import { App } from '../stores/app';
2024-09-01 20:53:44 -05:00
export function Plugs() {
2024-10-09 21:04:49 -05:00
return (
<App.Provider>
<Content />
</App.Provider>
);
}
function Content() {
2024-10-20 01:01:54 -05:00
const promoteOpentest =
assertSecret(import.meta.env.PUBLIC_PROMOTE_OPENTEST) === 'true' &&
2025-06-08 17:32:13 +00:00
assertSecret(import.meta.env.PUBLIC_BRANCH) !== 'opentest';
2024-10-20 01:01:54 -05:00
const promotions = [promoteOpentest];
if (promotions.every((promotion) => !promotion)) return null;
2024-09-01 20:53:44 -05:00
return (
<Flex
align="center"
direction="column"
justify="center"
px="4"
py="8"
gap="6"
>
2024-10-20 01:01:54 -05:00
{promoteOpentest && (
<Flex direction="column" gap="3" align="center">
<Text size="5">
BlitzKit{' '}
2024-11-24 20:30:42 -06:00
<Code variant="outline" size="4" color="gray">
2024-10-20 01:01:54 -05:00
opentest
</Code>{' '}
is available now{' '}
</Text>
2024-09-04 22:16:31 -05:00
2024-10-20 01:01:54 -05:00
<Link href="https://opentest.blitzkit.app/" target="_blank">
<Button color="green">
BlitzKit opentest <ArrowRightIcon />
</Button>
</Link>
</Flex>
)}
2024-09-01 20:53:44 -05:00
</Flex>
);
}