import {Component} from "preact"; import {type TourData} from "../../tours/exports.js"; type Props = { hasBeenCompleted: boolean; tour: TourData; }; function tourLink(tour: TourData): string { const anchor = `#tildes-shepherd-tour=${tour.id}`; const baseUrl = "https://tildes.net"; const path = tour.requirements.path; return `${baseUrl}${path}${anchor}`; } export class Tour extends Component { render() { const {hasBeenCompleted, tour} = this.props; const classes = ["tour", hasBeenCompleted ? "completed" : ""].join(" "); const completed = hasBeenCompleted ? (

) : undefined; return (

{tour.title}

{completed} {tour.description}
); } }