1
0
mirror of https://github.com/uetchy/namae.git synced 2025-07-07 00:16:00 +09:00

35 lines
930 B
TypeScript
Raw Normal View History

2020-08-31 08:41:53 +09:00
import React from 'react';
import { useTranslation } from 'react-i18next';
2021-02-25 15:13:15 +09:00
import { normalize } from '../../../util/text';
2020-08-31 08:41:53 +09:00
import { NetlifyIcon } from '../../Icons';
2019-10-16 14:14:02 +09:00
2020-08-31 08:41:53 +09:00
import { Card, Repeater, DedicatedAvailability } from '../core';
2019-10-16 14:14:02 +09:00
2020-08-20 00:57:33 +09:00
const NetlifyCard: React.FC<{ query: string }> = ({ query }) => {
2020-08-31 08:41:53 +09:00
const { t } = useTranslation();
2021-02-25 15:13:15 +09:00
const normalizedQuery = normalize(query, {
allowUnderscore: false,
});
const lowerCase = normalizedQuery.toLowerCase();
2019-10-16 14:14:02 +09:00
2020-08-31 08:41:53 +09:00
const names = [lowerCase];
2019-10-16 14:14:02 +09:00
return (
<Card title={t('providers.netlify')}>
<Repeater items={names}>
{(name) => (
<DedicatedAvailability
name={`${name}.netlify.com`}
service="existence"
2021-06-20 19:57:15 +09:00
message={`Go to ${name}.netlify.com`}
2019-10-16 14:14:02 +09:00
link={`https://${name}.netlify.com`}
icon={<NetlifyIcon />}
/>
)}
</Repeater>
</Card>
2020-08-31 08:41:53 +09:00
);
};
2019-10-16 14:14:02 +09:00
2020-08-31 08:41:53 +09:00
export default NetlifyCard;