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/GitHubOrganization.tsx
Normal file
40
components/cards/providers/GitHubOrganization.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { FaGithub } from 'react-icons/fa';
|
||||
import { normalize } from '../../../util/text';
|
||||
import { Card, DedicatedAvailability, Repeater } from '../core';
|
||||
|
||||
const GithubCard: React.FC<{ query: string }> = ({ query }) => {
|
||||
const { t } = useTranslation();
|
||||
const normalizedQuery = normalize(query, {});
|
||||
const lowerCase = normalizedQuery.toLowerCase();
|
||||
|
||||
const names = [
|
||||
normalizedQuery,
|
||||
`${lowerCase}-dev`,
|
||||
`${lowerCase}-org`,
|
||||
`${lowerCase}-team`,
|
||||
`${lowerCase}hq`,
|
||||
];
|
||||
const moreNames = [`${lowerCase}js`, `${lowerCase}-rs`];
|
||||
|
||||
return (
|
||||
<Card title={t('providers.github')}>
|
||||
<Repeater items={names} moreItems={moreNames}>
|
||||
{(name) => (
|
||||
<DedicatedAvailability
|
||||
name={name}
|
||||
query={`github.com/${name}`}
|
||||
service="existence"
|
||||
message={`Go to github.com/${name}`}
|
||||
link={`https://github.com/${name}`}
|
||||
prefix="github.com/"
|
||||
icon={<FaGithub />}
|
||||
/>
|
||||
)}
|
||||
</Repeater>
|
||||
</Card>
|
||||
);
|
||||
};
|
||||
|
||||
export default GithubCard;
|
Reference in New Issue
Block a user