mirror of
https://github.com/uetchy/namae.git
synced 2025-08-21 02:08:12 +09:00
fix: support new vercel style
This commit is contained in:
34
src/components/cards/providers/PyPI.tsx
Normal file
34
src/components/cards/providers/PyPI.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import React from 'react';
|
||||
import {useTranslation} from 'react-i18next';
|
||||
import {FaPython} from 'react-icons/fa';
|
||||
|
||||
import {capitalize} from '../../../util/text';
|
||||
import {Card, DedicatedAvailability, Repeater} from '../core';
|
||||
|
||||
const PypiCard: React.FC<{query: string}> = ({query}) => {
|
||||
const {t} = useTranslation();
|
||||
|
||||
const names = [query];
|
||||
const moreNames = [`Py${capitalize(query)}`];
|
||||
|
||||
return (
|
||||
<Card title={t('providers.pypi')}>
|
||||
<Repeater items={names} moreItems={moreNames}>
|
||||
{(name) => (
|
||||
<DedicatedAvailability
|
||||
name={name}
|
||||
query={`pypi.org/pypi/${name}/json`}
|
||||
service="existence"
|
||||
message="Read Python Packaging User Guide"
|
||||
link="https://packaging.python.org/"
|
||||
messageIfTaken="Go to PyPI"
|
||||
linkIfTaken={`https://pypi.org/project/${name}`}
|
||||
icon={<FaPython />}
|
||||
/>
|
||||
)}
|
||||
</Repeater>
|
||||
</Card>
|
||||
);
|
||||
};
|
||||
|
||||
export default PypiCard;
|
Reference in New Issue
Block a user