// @jsxImportSource xeact // @jsxRuntime automatic import { u, useState } from "xeact"; export interface MastodonShareButtonProps { title: string; url: string; series?: string; tags: string; } export default function MastodonShareButton( { title, url = u(), series, tags }: MastodonShareButtonProps, ) { let defaultURL = localStorage["mastodon_instance"]; if (defaultURL == undefined) { defaultURL = ""; } const tootTemplate = `${title} ${url} ${series ? "#" + series + " " : ""}${ tags ? tags.map((x) => "#" + x).join(" ") : "" } @cadey@pony.social`; const [getURL, setURL] = useState(defaultURL); const [getToot, setToot] = useState(tootTemplate); return (