1
0
mirror of https://github.com/uetchy/namae.git synced 2025-07-07 00:16:00 +09:00

32 lines
807 B
TypeScript
Raw Normal View History

2020-08-20 00:57:33 +09:00
import React from 'react'
import { useTranslation } from 'react-i18next'
import { OcamlIcon } from '../../Icons'
2020-02-05 19:56:59 +09:00
2020-08-20 00:57:33 +09:00
import { Card, Repeater, DedicatedAvailability } from '../core'
2020-02-05 19:56:59 +09:00
2020-08-20 00:57:33 +09:00
const OcamlCard: React.FC<{ query: string }> = ({ query }) => {
const { t } = useTranslation()
const lowerCase = query.toLowerCase()
2020-02-05 19:56:59 +09:00
2020-08-20 00:57:33 +09:00
const names = [lowerCase]
2020-02-05 19:56:59 +09:00
return (
<Card title={t('providers.ocaml')}>
<Repeater items={names}>
{(name) => (
<DedicatedAvailability
name={name}
query={`opam.ocaml.org/packages/${name}/`}
service="existence"
2020-03-26 20:22:06 +09:00
message="Go to opam"
2020-02-05 19:56:59 +09:00
link={`https://opam.ocaml.org/packages/${name}/`}
icon={<OcamlIcon />}
/>
)}
</Repeater>
</Card>
2020-08-20 00:57:33 +09:00
)
}
2020-02-05 19:56:59 +09:00
2020-08-20 00:57:33 +09:00
export default OcamlCard