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

36 lines
953 B
TypeScript
Raw Normal View History

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