addeds embeds for profiles

This commit is contained in:
Rose 2024-10-16 09:45:26 -05:00
parent c90a4c141e
commit 5b5e21e614
No known key found for this signature in database
9 changed files with 1006 additions and 896 deletions

View file

@ -0,0 +1,31 @@
import { AppBskyActorDefs } from "@atproto/api";
import { OEmbedTypes } from "../routes/getOEmbed.ts";
import { Layout } from "./Layout.tsx";
interface ProfileProps {
profile: AppBskyActorDefs.ProfileViewDetailed;
url: string;
appDomain: string;
}
export const Profile = ({ profile, url, appDomain }: ProfileProps) => (
<Layout url={url}>
<meta name="twitter:creator" content={`@${profile.handle}`} />
<meta property="og:description" content={profile.description ?? ""} />
<meta
property="og:title"
content={`${profile.displayName} (@${profile.handle})`}
/>
<meta property="og:image" content={profile.avatar} />
<link
type="application/json+oembed"
href={`https://${appDomain}/oembed?type=${OEmbedTypes.Profile}&follows=${
profile.followsCount
}&posts=${profile.postsCount}&avatar=${encodeURIComponent(
profile.avatar ?? ""
)}`}
/>
</Layout>
);