import { Component } from "inferno"; import { Post } from "lemmy-js-client"; import * as sanitizeHtml from "sanitize-html"; import { relTags } from "../../config"; import { Icon } from "../common/icon"; interface MetadataCardProps { post: Post; } export class MetadataCard extends Component { constructor(props: any, context: any) { super(props, context); } render() { const post = this.props.post; if (post.embed_title && post.url) { return (
{post.name !== post.embed_title && ( <>
{post.embed_title}
{new URL(post.url).hostname} )} {post.embed_description && (
)}
); } else { return <>; } } }