diff --git a/src/components/ProfileFormLink.astro b/src/components/FormLink.astro similarity index 58% rename from src/components/ProfileFormLink.astro rename to src/components/FormLink.astro index 513f0b0..48b8b61 100644 --- a/src/components/ProfileFormLink.astro +++ b/src/components/FormLink.astro @@ -1,9 +1,23 @@ --- -// "Use the profile form" box for the documentation guides (forms.profile in src/data/site.ts). +// "Use the … form" box for the documentation guides (forms in src/data/site.ts). import Button from "./ui/Button.astro"; import Icon from "./ui/Icon.astro"; import Todo from "./ui/Todo.astro"; import { forms, site } from "../data/site"; + +interface Props { + form: keyof typeof forms; +} + +const copy = { + profile: { name: "profile form", text: "Add or update your profile, photo and projects with one form.", repo: "marc_people" }, + news: { name: "news form", text: "Send a news article or a vacancy, with photos, or correct a published article.", repo: "marc_news" }, +} satisfies Record; + +const { form } = Astro.props; +const href = forms[form]; +const { name, text, repo } = copy[form]; +const linkSubject = `${name[0].toUpperCase()}${name.slice(1)} link`; --- { - forms.profile && ( - ) } -{!forms.profile && Set forms.profile in src/data/site.ts to the form's share link (marc_people/google-form/README.md, step 7).} +{!href && Set forms.{form} in src/data/site.ts to the form's share link ({repo}/google-form/README.md, step 7).}