✨ addeds embeds for profiles
This commit is contained in:
parent
c90a4c141e
commit
5b5e21e614
9 changed files with 1006 additions and 896 deletions
31
src/components/Profile.tsx
Normal file
31
src/components/Profile.tsx
Normal 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>
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue