2019-08-02 16:27:05 +09:00
|
|
|
import React from 'react'
|
2019-08-03 13:36:29 +09:00
|
|
|
import { useTranslation } from 'react-i18next'
|
2019-08-02 16:27:05 +09:00
|
|
|
import { FaGem } from 'react-icons/fa'
|
2019-08-06 00:45:18 +09:00
|
|
|
|
|
|
|
import { Card, Repeater, DedicatedAvailability } from '../Cards'
|
2019-08-02 16:27:05 +09:00
|
|
|
|
2019-08-06 02:07:05 +09:00
|
|
|
export default function RubyGemsCard({ query }) {
|
2019-08-03 13:36:29 +09:00
|
|
|
const { t } = useTranslation()
|
|
|
|
|
2019-08-06 02:07:05 +09:00
|
|
|
const names = [query]
|
|
|
|
const moreNames = [`${query.toLowerCase()}-rb`]
|
2019-08-06 00:45:18 +09:00
|
|
|
|
2019-08-02 16:27:05 +09:00
|
|
|
return (
|
2019-08-06 00:45:18 +09:00
|
|
|
<Card title={t('providers.rubygems')}>
|
|
|
|
<Repeater items={names} moreItems={moreNames}>
|
|
|
|
{(name) => (
|
|
|
|
<DedicatedAvailability
|
|
|
|
name={name}
|
|
|
|
service="rubygems"
|
2019-08-07 22:25:51 +09:00
|
|
|
message="Read Publishing Guide"
|
|
|
|
link="https://guides.rubygems.org/publishing/"
|
|
|
|
messageIfTaken="Go to RubyGems"
|
|
|
|
linkIfTaken={`https://rubygems.org/gems/${name}`}
|
2019-08-06 00:45:18 +09:00
|
|
|
icon={<FaGem />}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
</Repeater>
|
2019-08-02 16:27:05 +09:00
|
|
|
</Card>
|
|
|
|
)
|
|
|
|
}
|