a tool for shared writing and social publishing
1import { PubListing } from "app/discover/PubListing";
2import { ButtonPrimary } from "components/Buttons";
3import { DiscoverSmall } from "components/Icons/DiscoverSmall";
4import { Json } from "supabase/database.types";
5
6export const SubscriptionsContent = (props: {
7 publications: {
8 record: Json;
9 uri: string;
10 documents_in_publications: {
11 documents: { data: Json; indexed_at: string } | null;
12 }[];
13 }[];
14}) => {
15 if (props.publications.length === 0) return <SubscriptionsEmpty />;
16
17 return (
18 <div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 gap-3">
19 {props.publications?.map((p) => <PubListing {...p} />)}
20 </div>
21 );
22};
23
24const SubscriptionsEmpty = () => {
25 return (
26 <div className="flex flex-col gap-2 container bg-[rgba(var(--bg-page),.7)] sm:p-4 p-3 justify-between text-center font-bold text-tertiary">
27 You haven't subscribed to any publications yet!
28 <ButtonPrimary className="mx-auto place-self-center">
29 <DiscoverSmall /> Discover Publications
30 </ButtonPrimary>
31 </div>
32 );
33};