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 { IoIosBeer } from 'react-icons/io'
|
2019-07-31 18:54:28 +09:00
|
|
|
import { Card } from '../Cards'
|
2019-08-05 22:59:39 +09:00
|
|
|
import { ExistentialAvailability } from '../Cards'
|
2019-07-31 13:11:00 +09:00
|
|
|
|
|
|
|
export default function HomebrewCard({ name }) {
|
2019-08-03 13:36:29 +09:00
|
|
|
const { t } = useTranslation()
|
2019-07-31 13:11:00 +09:00
|
|
|
const lowerCase = name.toLowerCase()
|
|
|
|
|
|
|
|
return (
|
2019-08-03 16:44:48 +09:00
|
|
|
<Card title={t('providers.homebrew')} nameList={[lowerCase]}>
|
2019-07-31 13:11:00 +09:00
|
|
|
{(name) => (
|
|
|
|
<>
|
|
|
|
<ExistentialAvailability
|
|
|
|
name={name}
|
|
|
|
target={`https://formulae.brew.sh/api/formula/${name}.json`}
|
2019-07-31 13:40:16 +09:00
|
|
|
link={`https://formulae.brew.sh/formula/${name}`}
|
2019-07-31 13:11:00 +09:00
|
|
|
icon={<IoIosBeer />}
|
|
|
|
/>
|
|
|
|
<ExistentialAvailability
|
|
|
|
name={name}
|
|
|
|
target={`https://formulae.brew.sh/api/cask/${name}.json`}
|
2019-07-31 13:40:16 +09:00
|
|
|
link={`https://formulae.brew.sh/cask/${name}`}
|
2019-07-31 13:11:00 +09:00
|
|
|
suffix=" (Cask)"
|
|
|
|
icon={<IoIosBeer />}
|
|
|
|
/>
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
</Card>
|
|
|
|
)
|
|
|
|
}
|