2024-02-01 19:59:51 +01:00
|
|
|
'use client'
|
|
|
|
|
2024-02-04 23:09:00 +01:00
|
|
|
import { MouseEvent } from 'react'
|
2022-11-16 00:14:59 +01:00
|
|
|
import meta from '../../../_content/meta.json'
|
|
|
|
|
|
|
|
export default function Vcard() {
|
2024-02-01 19:59:51 +01:00
|
|
|
const { name, label, email } = meta.author
|
2022-11-16 00:14:59 +01:00
|
|
|
|
|
|
|
const vCardMeta = {
|
|
|
|
...meta,
|
|
|
|
/// photoSrc,
|
|
|
|
name,
|
|
|
|
label,
|
|
|
|
email,
|
2024-02-01 19:59:51 +01:00
|
|
|
profiles: meta.profiles
|
2022-11-16 00:14:59 +01:00
|
|
|
}
|
|
|
|
|
2024-02-04 23:09:00 +01:00
|
|
|
const handleAddressbookClick = (e: MouseEvent) => {
|
2022-11-16 00:14:59 +01:00
|
|
|
e.preventDefault()
|
|
|
|
|
|
|
|
import('./_utils').then(({ init }) => {
|
|
|
|
init(vCardMeta)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<a
|
|
|
|
// href is kinda fake, only there for usability
|
|
|
|
// so user knows what to expect when hovering the link before clicking
|
|
|
|
href={meta.addressbook}
|
|
|
|
onClick={handleAddressbookClick}
|
|
|
|
>
|
|
|
|
Add to addressbook
|
|
|
|
</a>
|
|
|
|
)
|
|
|
|
}
|