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:
36
components/cards/providers/ModLand.tsx
Normal file
36
components/cards/providers/ModLand.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { SiDeno } from 'react-icons/si';
|
||||
import { normalize } from '../../../util/text';
|
||||
|
||||
import { Card, Repeater, DedicatedAvailability } from '../core';
|
||||
|
||||
const ModLandCard: React.FC<{ query: string }> = ({ query }) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const normalizedQuery = normalize(query, {
|
||||
allowUnderscore: false,
|
||||
});
|
||||
const lowerCase = normalizedQuery.toLowerCase();
|
||||
const names = [lowerCase];
|
||||
|
||||
return (
|
||||
<Card title={t('providers.modland')}>
|
||||
<Repeater items={names}>
|
||||
{(name) => (
|
||||
<DedicatedAvailability
|
||||
name={`${name}.mod.land`}
|
||||
service="dns"
|
||||
message="Go to mod.land repository"
|
||||
link="https://github.com/denosaurs/mod.land"
|
||||
messageIfTaken={`Go to ${name}.mod.land`}
|
||||
linkIfTaken={`https://${name}.mod.land`}
|
||||
icon={<SiDeno />}
|
||||
/>
|
||||
)}
|
||||
</Repeater>
|
||||
</Card>
|
||||
);
|
||||
};
|
||||
|
||||
export default ModLandCard;
|
Reference in New Issue
Block a user