2019-07-31 13:11:00 +09:00
|
|
|
import React from 'react'
|
2019-08-03 13:36:29 +09:00
|
|
|
import { useTranslation } from 'react-i18next'
|
2019-07-31 13:11:00 +09:00
|
|
|
import { FaPython } from 'react-icons/fa'
|
2019-08-06 00:45:18 +09:00
|
|
|
|
2019-08-02 16:27:19 +09:00
|
|
|
import { capitalize } from '../../util/text'
|
2019-08-06 00:45:18 +09:00
|
|
|
import { Card, DedicatedAvailability, Repeater } from '../Cards'
|
2019-07-31 13:11:00 +09:00
|
|
|
|
|
|
|
export default function PypiCard({ name }) {
|
2019-08-03 13:36:29 +09:00
|
|
|
const { t } = useTranslation()
|
|
|
|
|
2019-08-06 00:45:18 +09:00
|
|
|
const names = [name]
|
|
|
|
const moreNames = [`Py${capitalize(name)}`]
|
|
|
|
|
2019-07-31 13:11:00 +09:00
|
|
|
return (
|
2019-08-06 00:45:18 +09:00
|
|
|
<Card title={t('providers.pypi')}>
|
|
|
|
<Repeater items={names} moreItems={moreNames}>
|
|
|
|
{(name) => (
|
|
|
|
<DedicatedAvailability
|
|
|
|
name={name}
|
|
|
|
service="pypi"
|
|
|
|
link={`https://pypi.org/project/${name}`}
|
|
|
|
icon={<FaPython />}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
</Repeater>
|
2019-07-31 13:11:00 +09:00
|
|
|
</Card>
|
|
|
|
)
|
|
|
|
}
|