mirror of
https://github.com/uetchy/namae.git
synced 2025-08-20 09:58:13 +09:00
feat: add PyPI
This commit is contained in:
@@ -86,7 +86,7 @@ export function ExistenceAvailability({
|
||||
const response = useFetch(target, null, { metadata: true })
|
||||
|
||||
if (response.status !== 404 && response.status !== 200) {
|
||||
throw new Error(`Homebrew: ${response.statusText}`)
|
||||
throw new Error(`${name}: ${response.status}`)
|
||||
}
|
||||
|
||||
const availability = response.status === 404
|
||||
@@ -106,8 +106,6 @@ export function ExistenceAvailability({
|
||||
export function Alternatives({ nameList, children }) {
|
||||
const [show, setShow] = useState(false)
|
||||
|
||||
console.log(children)
|
||||
|
||||
function onClick() {
|
||||
setShow(true)
|
||||
}
|
||||
|
17
src/components/PypiCard.js
Normal file
17
src/components/PypiCard.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import React from 'react'
|
||||
import { Card, CardTitle, DedicatedAvailability } from './Card'
|
||||
import { FaPython } from 'react-icons/fa'
|
||||
|
||||
export default function PypiCard({ name }) {
|
||||
return (
|
||||
<Card key={name}>
|
||||
<CardTitle>PyPI</CardTitle>
|
||||
<DedicatedAvailability
|
||||
name={name}
|
||||
provider="pypi"
|
||||
url={`https://pypi.org/project/${name}`}
|
||||
icon={<FaPython />}
|
||||
/>
|
||||
</Card>
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user