2020-08-20 00:57:33 +09:00
|
|
|
import React from 'react'
|
|
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
import { NowIcon } from '../../Icons'
|
2019-08-06 00:45:18 +09:00
|
|
|
|
2020-08-20 00:57:33 +09:00
|
|
|
import { Card, Repeater, DedicatedAvailability } from '../core'
|
2019-07-31 13:11:00 +09:00
|
|
|
|
2020-08-20 00:57:33 +09:00
|
|
|
const VercelCard: React.FC<{ query: string }> = ({ query }) => {
|
|
|
|
const { t } = useTranslation()
|
2020-06-11 22:00:16 +09:00
|
|
|
|
2020-08-20 00:57:33 +09:00
|
|
|
const sanitizedQuery = query.replace(/[^0-9a-zA-Z_-]/g, '').replace(/_/g, '-')
|
|
|
|
const lowerCase = sanitizedQuery.toLowerCase()
|
2019-07-31 13:11:00 +09:00
|
|
|
|
2020-08-20 00:57:33 +09:00
|
|
|
const names = [lowerCase]
|
2019-08-06 00:45:18 +09:00
|
|
|
|
2019-07-31 13:11:00 +09:00
|
|
|
return (
|
2019-08-27 03:15:35 +09:00
|
|
|
<Card title={t('providers.now')}>
|
2020-06-18 20:32:42 +09:00
|
|
|
<Repeater items={names}>
|
|
|
|
{(name) => (
|
|
|
|
<DedicatedAvailability
|
|
|
|
name={`${name}.vercel.app`}
|
|
|
|
service="existence"
|
|
|
|
message={`Open ${name}.vercel.app`}
|
|
|
|
link={`https://${name}.vercel.app`}
|
|
|
|
icon={<NowIcon />}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
</Repeater>
|
2019-08-06 00:45:18 +09:00
|
|
|
<Repeater items={names}>
|
|
|
|
{(name) => (
|
|
|
|
<DedicatedAvailability
|
2019-08-27 03:15:35 +09:00
|
|
|
name={`${name}.now.sh`}
|
|
|
|
service="existence"
|
2019-10-16 14:14:02 +09:00
|
|
|
message={`Open ${name}.now.sh`}
|
2019-08-27 03:15:35 +09:00
|
|
|
link={`https://${name}.now.sh`}
|
|
|
|
icon={<NowIcon />}
|
2019-08-06 00:45:18 +09:00
|
|
|
/>
|
|
|
|
)}
|
|
|
|
</Repeater>
|
2019-07-31 13:11:00 +09:00
|
|
|
</Card>
|
2020-08-20 00:57:33 +09:00
|
|
|
)
|
|
|
|
}
|
2019-09-01 01:28:24 +09:00
|
|
|
|
2020-08-20 00:57:33 +09:00
|
|
|
export default VercelCard
|