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

48 lines
1.4 KiB
TypeScript
Raw Normal View History

2020-08-31 08:41:53 +09:00
import React from 'react';
import { useTranslation } from 'react-i18next';
2021-03-05 17:32:40 +09:00
import { SiDebian, SiUbuntu, SiArchlinux } from 'react-icons/si';
2021-02-25 15:13:15 +09:00
import { normalize } from '../../../util/text';
2020-08-31 09:45:16 +09:00
import { Card, DedicatedAvailability, Repeater } from '../core';
2019-08-05 22:59:47 +09:00
2020-08-20 00:57:33 +09:00
const LinuxCard: React.FC<{ query: string }> = ({ query }) => {
2020-08-31 08:41:53 +09:00
const { t } = useTranslation();
2021-02-25 15:13:15 +09:00
const normalizedQuery = normalize(query);
const lowerCase = normalizedQuery.toLowerCase();
2019-08-05 22:59:47 +09:00
2020-08-31 08:41:53 +09:00
const names = [lowerCase];
2019-08-06 00:45:18 +09:00
2019-08-05 22:59:47 +09:00
return (
2019-08-06 00:45:18 +09:00
<Card title={t('providers.linux')}>
<Repeater items={names}>
{(name) => (
<>
2021-03-05 17:32:40 +09:00
<DedicatedAvailability
name={name}
service="archlinux"
message="Go to ArchLinux.org"
link={`https://archlinux.org/packages/?sort=&q=${name}`}
icon={<SiArchlinux />}
/>
2019-08-06 00:45:18 +09:00
<DedicatedAvailability
name={name}
service="launchpad"
2020-03-26 20:22:06 +09:00
message="Go to Launchpad"
2019-08-06 00:45:18 +09:00
link={`https://launchpad.net/ubuntu/+source/${name}`}
2020-08-31 09:45:16 +09:00
icon={<SiUbuntu />}
2019-08-06 00:45:18 +09:00
/>
<DedicatedAvailability
name={name}
service="debian"
2020-03-26 20:22:06 +09:00
message="Go to debian.org"
2019-08-06 00:45:18 +09:00
link={`https://packages.debian.org/buster/${name}`}
2020-08-31 09:45:16 +09:00
icon={<SiDebian />}
2019-08-06 00:45:18 +09:00
/>
</>
)}
</Repeater>
2019-08-05 22:59:47 +09:00
</Card>
2020-08-31 08:41:53 +09:00
);
};
2019-09-01 01:28:24 +09:00
2020-08-31 08:41:53 +09:00
export default LinuxCard;