mirror of
https://github.com/uetchy/namae.git
synced 2025-08-20 18:08:11 +09:00
dev: initial attempt
This commit is contained in:
40
components/cards/providers/Cloudflare.tsx
Normal file
40
components/cards/providers/Cloudflare.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { FaCloudflare } from 'react-icons/fa';
|
||||
import { normalize } from '../../../util/text';
|
||||
|
||||
import { Card, Repeater, DedicatedAvailability } from '../core';
|
||||
|
||||
const CloudflareCard: React.FC<{ query: string }> = ({ query }) => {
|
||||
const { t } = useTranslation();
|
||||
const normalizedQuery = normalize(query, {
|
||||
alphanumeric: false,
|
||||
allowUnderscore: false,
|
||||
});
|
||||
const lowerCase = normalizedQuery.toLowerCase();
|
||||
|
||||
const names = [lowerCase];
|
||||
const moreNames = [
|
||||
`${lowerCase}-web`,
|
||||
`${lowerCase}-webapp`,
|
||||
`${lowerCase}-site`,
|
||||
];
|
||||
|
||||
return (
|
||||
<Card title={t('providers.cloudflare')}>
|
||||
<Repeater items={names} moreItems={moreNames}>
|
||||
{(name) => (
|
||||
<DedicatedAvailability
|
||||
name={`${name}.pages.dev`}
|
||||
service="dns"
|
||||
message={`Go to ${name}.pages.dev`}
|
||||
link={`https://${name}.pages.dev`}
|
||||
icon={<FaCloudflare />}
|
||||
/>
|
||||
)}
|
||||
</Repeater>
|
||||
</Card>
|
||||
);
|
||||
};
|
||||
|
||||
export default CloudflareCard;
|
Reference in New Issue
Block a user