/**
 * rSocials shared types and constants.
 *
 * Used by both server (mod.ts) and client (web components).
 */

// ── Feed types ──

export interface FeedItem {
	id: string;
	type: "post" | "link";
	author: string;
	content: string;
	url?: string;
	source: string;
	timestamp: string;
	likes: number;
	replies: number;
}

// ── Demo feed data ──

export interface DemoFeedPost {
	username: string;
	initial: string;
	color: string;
	content: string;
	timeAgo: string;
	likes: number;
	replies: number;
}

export const DEMO_FEED: DemoFeedPost[] = [
	{
		username: "@alice",
		initial: "A",
		color: "#6366f1",
		content: "Just deployed the new rFlows river view! The enoughness score is such a powerful concept. \u{1F30A}",
		timeAgo: "2 hours ago",
		likes: 5,
		replies: 2,
	},
	{
		username: "@bob",
		initial: "B",
		color: "#f59e0b",
		content: "Workshop recording is up on rTube: 'Introduction to Local-First Data'. Check it out!",
		timeAgo: "5 hours ago",
		likes: 8,
		replies: 4,
	},
	{
		username: "@carol",
		initial: "C",
		color: "#10b981",
		content: "The cosmolocal print network now has 6 providers across 4 countries. Design global, manufacture local! \u{1F30D}",
		timeAgo: "1 day ago",
		likes: 12,
		replies: 3,
	},
	{
		username: "@diana",
		initial: "D",
		color: "#ec4899",
		content: "Reading Elinor Ostrom's 'Governing the Commons' \u2014 so many parallels to what we're building with rSpace governance.",
		timeAgo: "1 day ago",
		likes: 7,
		replies: 5,
	},
	{
		username: "@eve",
		initial: "E",
		color: "#14b8a6",
		content: "New community garden plot assignments are up on rChoices. Vote for your preferred plot by Friday!",
		timeAgo: "2 days ago",
		likes: 3,
		replies: 1,
	},
	{
		username: "@frank",
		initial: "F",
		color: "#8b5cf6",
		content: "Mesh network node #42 is online! Coverage now extends to the community center. \u{1F4E1}",
		timeAgo: "3 days ago",
		likes: 15,
		replies: 6,
	},
];

// ── Platform character limits ──

export const PLATFORM_LIMITS: Record<string, number> = {
	twitter: 280,
	bluesky: 300,
	mastodon: 500,
	linkedin: 3000,
	plain: Infinity,
};
