1
0
mirror of https://github.com/uetchy/namae.git synced 2025-07-02 14:20:03 +09:00
namae/web/src/components/cards/HomebrewCard.js

37 lines
1.0 KiB
JavaScript
Raw Normal View History

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-08-06 00:45:18 +09:00
import { Card, Repeater, ExistentialAvailability } from '../Cards'
2019-07-31 13:11:00 +09:00
2019-08-06 02:07:05 +09:00
export default function HomebrewCard({ query }) {
2019-08-03 13:36:29 +09:00
const { t } = useTranslation()
2019-08-06 02:07:05 +09:00
const lowerCase = query.toLowerCase()
2019-07-31 13:11:00 +09:00
2019-08-06 00:45:18 +09:00
const names = [lowerCase]
2019-07-31 13:11:00 +09:00
return (
2019-08-06 00:45:18 +09:00
<Card title={t('providers.homebrew')}>
<Repeater items={names}>
{(name) => (
<>
<ExistentialAvailability
name={name}
target={`https://formulae.brew.sh/api/formula/${name}.json`}
link={`https://formulae.brew.sh/formula/${name}`}
icon={<IoIosBeer />}
/>
<ExistentialAvailability
name={name}
target={`https://formulae.brew.sh/api/cask/${name}.json`}
link={`https://formulae.brew.sh/cask/${name}`}
suffix=" (Cask)"
icon={<IoIosBeer />}
/>
</>
)}
</Repeater>
2019-07-31 13:11:00 +09:00
</Card>
)
}