1import { Markdown } from "@urbit/foundation-design-system";
2import EcosystemBadge from "./Badge";
4import Link from "next/link";
5export default function Post({ post }) {
6 return ["featured-1", "featured-2", "featured-3"].map((feat) => {
8 post[feat] && (post[feat]?.matchedPost?.type === "Application" || post[feat]?.matchedPost?.type === "Group")
9 ? `${post[feat]?.matchedPost.ship}/${post[feat].matchedPost.slug}`
10 : `${post[feat].matchedPost?.slug}`;
11 const href = post[feat]?.matchedPost
12 ? `/${post[feat].matchedPost.type.toLowerCase()}s/${childPath}`
14 return post?.[feat] ? (
16 className="mt-8 mb-24"
17 id={post?.[feat].title.toLowerCase().replace(/ /, "-")}
19 <div className="flex space-x-4 items-center">
21 className="h-24 w-24 rounded-xl items-center justify-center shrink-0 overflow-hidden"
24 post[feat]?.matchedPost?.bgColor || "rgba(0,0,0,0)",
27 {(post[feat]?.matchedPost?.image || post[feat]?.matchedPost?.tile) && (
29 className="rounded-xl w-24 object-cover"
30 src={post[feat]?.matchedPost?.image || post[feat]?.matchedPost?.tile}
34 <div className="flex flex-col">
35 <h4 className="text-xl pb-2 leading-6 font-bold">
38 <EcosystemBadge type={post[feat].type} />
41 <div className="markdown mt-8 mb-8">
42 <Markdown.render content={JSON.parse(post[feat].content)} />
45 {post[feat].type === "Podcast" && (
46 <Link href={href || "#"} passHref>
47 <a class="button-sm text-white flex-col bg-green-400 cursor-pointer pr-4 w-fit">
48 Listen to {post[feat].type}
53 {post[feat].type === "Article" && (
54 <Link href={href || "#"} passHref>
55 <a class="button-sm text-white flex-col bg-green-400 cursor-pointer pr-4 w-fit">
56 Read {post[feat].type}
61 {post[feat].type === "Application" && (
62 <Link href={href || "#"} passHref>
63 <a class="button-sm text-white flex-col bg-green-400 cursor-pointer pr-4 w-fit">
64 View {post[feat].type}
69 {post[feat].type === "Organization" && (
70 <Link href={href || "#"} passHref>
71 <a class="button-sm text-white flex-col bg-green-400 cursor-pointer pr-4 w-fit">
72 More about {post[feat].title}
77 {post[feat].type === "Community" && (
78 <Link href={href || "#"} passHref>
79 <a class="button-sm text-white flex-col bg-green-400 cursor-pointer pr-4 w-fit">
80 More about {post[feat].title}
86 {post[feat].type === "Marketplace" && (
87 <Link href={href || "#"} passHref>
88 <a class="button-sm text-white flex-col bg-green-400 cursor-pointer pr-4 w-fit">
89 More about {post[feat].title}
94 {post[feat].type === "Group" && (
95 <Link href={href || "#"} passHref>
96 <a class="button-sm text-white flex-col bg-green-400 cursor-pointer pr-4 w-fit">
97 More about {post[feat].title}
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list