not-found.tsx
This file
Path
apps/web/src/features/code/not-found.tsx
56 lines · 1.7 KiB · TypeScript
Last changed by
Merge redesign into mainoscabrielbefore adoptioncaedd21
History of this fileTake it
Merge build/1211-code-browseroscabrielbefore adoptiona6808d3
line 1why, one step back1import type { Refusal } from "@repo/protocol/refusal";Merge branch 'build/904-web-code-browser'oscabrielbefore adoption06e2229
line 2why, one step back2import { Option, Schema } from "effect";Merge build/1211-code-browseroscabrielbefore adoptiona6808d3
line 3why, one step back3import type { Array } from "effect";Merge branch 'build/904-web-code-browser'oscabrielbefore adoption06e2229
line 4why, one step back4Merge build/1211-code-browseroscabrielbefore adoptiona6808d3
lines 5–6why, one step back5import { EmptyState } from "../shared/empty.tsx";6import { AppLink } from "../shared/link.tsx";Merge build/1300-w13-foundation into mainoscabrielbefore adoption0e29c37
line 7why, one step back7import { ASKS_PATH } from "../shared/paths.ts";Merge build/1211-code-browseroscabrielbefore adoptiona6808d3
line 8why, one step back8import { RefusalView } from "../shared/refusal.tsx";Fold every page's project events once, keep Markdown off the first load, and cache what never changesoscabrielbefore adoption38e5215
line 9why, one step back9import { Refusals } from "../shared/refusals.ts";Merge build/1211-code-browseroscabrielbefore adoptiona6808d3
lines 10–12why, one step back10import { Workspace } from "../shared/shell/workspace.tsx";11import { SoftLanding } from "./soft-landing.ts";12import { TreeView } from "./tree-view.tsx";Merge branch 'build/904-web-code-browser'oscabrielbefore adoption06e2229
line 13why, one step back13Merge build/1211-code-browseroscabrielbefore adoptiona6808d3
lines 14–15why, one step back14const decodeLanding = Schema.decodeUnknownOption(SoftLanding);15Merge branch 'build/904-web-code-browser'oscabrielbefore adoption06e2229
lines 16–17why, one step back16const decodeRefusals = Schema.decodeUnknownOption(Refusals);17Merge build/1211-code-browseroscabrielbefore adoptiona6808d3
lines 18–20why, one step back18const LINK = "decoration-rule underline hover:decoration-current";1920export const NOTHING =Merge branch 'build/904-web-code-browser'oscabrielbefore adoption06e2229
lines 21–22why, one step back21 "Nothing is at this address: a code page names a project, then main, a whole 40-hex commit id or a tag, then a path in the project.";22Merge build/1211-code-browseroscabrielbefore adoptiona6808d3
lines 23–34why, one step back23const Refused = ({24 refusals,25}: {26 readonly refusals: Array.NonEmptyReadonlyArray<Refusal> | undefined;27}) => (28 <Workspace title="Not found">29 {refusals === undefined ? (30 <EmptyState title={NOTHING} />31 ) : (32 <RefusalView refusals={refusals} />33 )}34 <p className="text-ui flex flex-wrap gap-x-4 gap-y-1">Merge build/1300-w13-foundation into mainoscabrielbefore adoption0e29c37
line 35why, one step back35 <AppLink className={LINK} to={ASKS_PATH}>Merge build/1211-code-browseroscabrielbefore adoptiona6808d3
lines 36–39why, one step back36 Open asks37 </AppLink>38 </p>39 </Workspace>Merge branch 'build/904-web-code-browser'oscabrielbefore adoption06e2229
line 40why, one step back40);Merge build/1211-code-browseroscabrielbefore adoptiona6808d3
line 41why, one step back41Merge redesign into mainoscabrielbefore adoptioncaedd21
line 42why, one step back42export const CodeNotFound = ({ data }: { readonly data?: unknown }) =>Merge build/1211-code-browseroscabrielbefore adoptiona6808d3
lines 43–56why, one step back43 Option.match(decodeLanding(data), {44 onNone: () => (45 <Refused refusals={Option.getOrUndefined(decodeRefusals(data))} />46 ),47 onSome: (landing) => (48 <TreeView49 listing={landing.nearest}50 notice={<RefusalView refusals={landing.refusals} />}51 now={landing.now}52 project={landing.project}53 rev={landing.rev}54 />55 ),56 });