mirror of
https://github.com/hanzo-apps/university.git
synced 2026-11-02 20:17:27 +00:00
The checkout pages hand off to hanzo.ai's own checkout (Hanzo sign-in, then the card on Square). The page that took card numbers into its own fields and reported a payment that was never made is removed. Co-authored-by: Hanzo Dev <[email protected]>
41 lines
1.0 KiB
TypeScript
41 lines
1.0 KiB
TypeScript
import { notFound } from 'next/navigation'
|
|
import type { Metadata } from 'next'
|
|
import { ALL_COURSES, findCourse } from '../../courses-data'
|
|
import { Moved } from './Moved'
|
|
|
|
export function generateStaticParams() {
|
|
return ALL_COURSES.map((c) => ({
|
|
slug: c.slug,
|
|
}))
|
|
}
|
|
|
|
export async function generateMetadata({
|
|
params,
|
|
}: {
|
|
params: Promise<{ slug: string }>
|
|
}): Promise<Metadata> {
|
|
const { slug } = await params
|
|
const course = findCourse(slug)
|
|
if (!course) return { title: 'Tuition Checkout — Hanzo University' }
|
|
const title = `Enroll in ${course.code}: ${course.title} — Hanzo University Checkout`
|
|
return {
|
|
title,
|
|
description: `Enroll in ${course.code}: ${course.title} through Hanzo checkout.`,
|
|
openGraph: {
|
|
title,
|
|
description: `Enroll in ${course.code}: ${course.title} through Hanzo checkout.`,
|
|
},
|
|
}
|
|
}
|
|
|
|
export default async function Page({
|
|
params,
|
|
}: {
|
|
params: Promise<{ slug: string }>
|
|
}) {
|
|
const { slug } = await params
|
|
const course = findCourse(slug)
|
|
if (!course) notFound()
|
|
return <Moved />
|
|
}
|