export const LEAFLET_BASE = 'https://retrobailey.leaflet.pub';

export type ArticleSlug = { slug: string; leafletSlug: string };

export const ARTICLE_SLUGS = [
	{ slug: 'getting-started-with-rust-an-rp2040', leafletSlug: '3mnnskzjn6k2c' },
	{ slug: 'mays-recap', leafletSlug: '3mnqarcodjk2k' },
	{ slug: 'missed-fundamentals', leafletSlug: '3mnnvofo7y22b' },
	{ slug: 'pico-sapien', leafletSlug: '3mnnrrvtjos2o' },
	{ slug: 'pico-w-webserver-with-rust', leafletSlug: '3mnnti2hpkk2u' },
	{ slug: 'poststation-on-the-rp2350', leafletSlug: '3mnpznkgclc2r' },
	{ slug: 'rust-on-the-10-cent-microcontroller', leafletSlug: '3mnpv64zct22z' },
	{ slug: 'rust-on-the-3ds', leafletSlug: '3mnq454jue22p' },
	{ slug: 'rusty-statusphere', leafletSlug: '3mnqaa5dj2s2e' }
] as const;

export const articleTarget = (slug: string) => {
	const article = ARTICLE_SLUGS.find((a) => a.slug === slug);
	if (!article) return null;
	return `${LEAFLET_BASE}/${article.leafletSlug}`;
};
