mirror of
https://github.com/hanzo-apps/magazine.git
synced 2026-10-30 19:11:40 +00:00
Real Hanzo-stack starter: Vite + React 19 + @hanzo/gui + @hanzo/iam + @hanzo/base. Three editorial views (newsstand, issue contents, article read) built from @hanzo/gui primitives; black/white/one-hot-red magazine design in src/press.tsx. schema.sql provisions org-scoped issues + articles collections. tsc + vite build green.
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import type { BaseRecord } from '@hanzo/base/react'
|
|
|
|
/**
|
|
* In-app navigation — one static SPA, no router dependency. The signed-in
|
|
* shell holds a single `Route` in state and hands `Go` to each view. Only
|
|
* `/auth/callback` is matched off the URL (in app.tsx); everything else is a
|
|
* value here, so the three views stay decoupled from each other.
|
|
*/
|
|
export type Route =
|
|
| { at: 'newsstand' }
|
|
| { at: 'issue'; issue: string }
|
|
| { at: 'article'; issue: string; article: string }
|
|
|
|
export type Go = (route: Route) => void
|
|
|
|
/** One row of the `issues` collection (see schema.sql). */
|
|
export interface Issue extends BaseRecord {
|
|
number: number
|
|
title: string
|
|
cover_line: string
|
|
published_at: string
|
|
published: boolean
|
|
}
|
|
|
|
/** One row of the `articles` collection (see schema.sql). */
|
|
export interface Article extends BaseRecord {
|
|
issue_id: string
|
|
title: string
|
|
dek: string
|
|
body: string
|
|
department: string
|
|
is_cover: boolean
|
|
order: number
|
|
}
|
|
|
|
/** Departments a piece can run under — presets that guide the newsroom. */
|
|
export const departments = ['Features', 'Dispatch', 'Interview', 'Essay', 'Review', 'The Back Page'] as const
|