Files
kycnotme/web/src/components/Footer.astro

80 lines
1.6 KiB
Plaintext
Raw Normal View History

2025-05-19 10:23:36 +00:00
---
import { Icon } from 'astro-icon/components'
2025-06-11 22:28:53 +00:00
import { SOURCE_CODE_URL } from 'astro:env/client'
import { I2P_ADDRESS, ONION_ADDRESS } from 'astro:env/server'
2025-05-19 10:23:36 +00:00
import { cn } from '../lib/cn'
import type { HTMLAttributes } from 'astro/types'
type Props = HTMLAttributes<'footer'>
const links = [
{
href: SOURCE_CODE_URL,
2025-05-20 11:00:28 +00:00
label: 'Code',
2025-05-19 10:23:36 +00:00
icon: 'ri:git-repository-line',
external: true,
},
2025-05-31 10:02:50 +00:00
{
href: ONION_ADDRESS,
label: 'Tor',
icon: 'onion',
external: true,
},
{
href: I2P_ADDRESS,
label: 'I2P',
icon: 'i2p',
external: true,
},
2025-05-20 11:00:28 +00:00
{
2025-05-31 10:01:35 +00:00
href: '/docs/api',
label: 'API',
icon: 'ri:plug-line',
external: false,
2025-05-20 11:00:28 +00:00
},
2025-06-10 17:42:42 +00:00
{
href: '/feeds',
label: 'RSS',
icon: 'ri:rss-line',
external: false,
},
2025-05-19 10:23:36 +00:00
{
href: '/about',
label: 'About',
icon: 'ri:information-line',
external: false,
},
] as const satisfies {
href: string
label: string
icon: string
external: boolean
}[]
const { class: className, ...htmlProps } = Astro.props
---
2025-06-10 17:42:42 +00:00
<footer
class={cn('xs:gap-x-6 flex flex-wrap items-center justify-center gap-x-3 gap-y-2 p-4', className)}
{...htmlProps}
>
2025-05-19 10:23:36 +00:00
{
links.map(
({ href, label, icon, external }) =>
href && (
<a
href={href}
target={external ? '_blank' : undefined}
rel={external ? 'noopener noreferrer' : undefined}
2025-06-10 17:42:42 +00:00
class="text-day-500 xs:gap-1 flex items-center gap-0.5 text-sm transition-colors hover:text-gray-200 hover:underline"
2025-05-19 10:23:36 +00:00
>
2025-06-10 17:42:42 +00:00
<Icon name={icon} class="xs:opacity-100 h-4 w-4 opacity-40" />
2025-05-19 10:23:36 +00:00
{label}
</a>
)
)
}
</footer>