mirror of
https://github.com/sern-handler/website
synced 2026-06-27 18:22:22 +00:00
34 lines
719 B
Plaintext
34 lines
719 B
Plaintext
---
|
|
import config from 'virtual:starlight/user-config';
|
|
import Icon from '../user-components/Icon.astro';
|
|
import type { Props } from '../props';
|
|
|
|
type Platform = keyof NonNullable<typeof config.social>;
|
|
type SocialConfig = NonNullable<NonNullable<typeof config.social>[Platform]>;
|
|
const links = Object.entries(config.social || {}) as [Platform, SocialConfig][];
|
|
---
|
|
|
|
{
|
|
links.length > 0 && (
|
|
<>
|
|
{links.map(([platform, { label, url }]) => (
|
|
<a href={url} rel="me" class="sl-flex">
|
|
<span class="sr-only">{label}</span>
|
|
<Icon name={platform} />
|
|
</a>
|
|
))}
|
|
</>
|
|
)
|
|
}
|
|
|
|
<style>
|
|
a {
|
|
color: var(--sl-color-text-accent);
|
|
padding: 0.5em;
|
|
margin: -0.5em;
|
|
}
|
|
a:hover {
|
|
opacity: 0.66;
|
|
}
|
|
</style>
|