import {Component, type JSX} from "preact"; type Props = { hasBeenCompleted: boolean; name: string; tourId: TourId; }; function tourDescription(tourId: Props["tourId"]): JSX.Element { if (tourId === "introduction") { return (

A short introduction to Tildes Shepherd and how the tours work. Normally this is automatically shown when you first installed the extension.

); } if (tourId === "interface-homepage") { return (

Let's take a look at the home page and all we can do there.

); } return (

Tour ID "{tourId}" does not have a description, this should probably be fixed!

); } function tourLink(tourId: Props["tourId"]): string { const anchor = `#tildes-shepherd-tour=${tourId}`; const baseUrl = "https://tildes.net"; let path = ""; switch (tourId) { case "interface-homepage": case "introduction": { path = "/"; break; } default: } return `${baseUrl}${path}${anchor}`; } export class Tour extends Component { render() { const {hasBeenCompleted, name, tourId} = this.props; const classes = ["tour", hasBeenCompleted ? "completed" : ""].join(" "); const completed = hasBeenCompleted ? (

) : undefined; return (

{name}

{completed} {tourDescription(tourId)}
); } }