Files
supabase/apps/studio/components/interfaces/App/NotFoundPage.tsx
Alaister YoungandAlaister Young cf223ae74a [FE-3106] (part 13) – chore(studio): remove next entry files and config (#53222)
Removes the Next-only entry files and config now that every page lives
in `routes/**` (FE-3106). `routes/__root.tsx` already mirrors
`pages/_app.tsx` (dayjs plugins, providers, telemetry, error boundary,
favicons). Part 13 of the stack.

**Depends on:** #53221

**Changed:**
- `components/interfaces/App/{NotFoundPage,ServerErrorPage}.tsx` – the
404/500 pages, rendered by `__root.tsx`, now with native
`Link`/`useNavigate` and `<img>`
- `routes/api/{status-page,scoped-access-token-permissions}.ts` – App
Router handlers from `app/api/**` moved in (`NextResponse.json` →
`Response.json`); `buildAPIPermissionScopeMap` moves to `lib/api/`
- `package.json`, `tsconfig.json` – no `next typegen` step or
`.next/types` include
- `packages/ui-patterns/.../InstructionBlocks.tsx` – asset map typed
`StaticImageData | string`: under Vite a png import is a URL string,
which Next's global image types used to hide
- `vite.config.ts`, `knip.jsonc`, `turbo.jsonc` and comments across
studio – Next build references removed

**Removed:**
- `pages/{_app,_document,404,500}.tsx`, `pages/_error.jsx`,
`pages/README.md`, `app/**`, `next.config.ts`, `proxy.ts`,
`instrumentation{,-client}.ts`, `sentry.{server,edge}.config.ts`,
`fonts/index.ts` (next/font), `BootTimeoutFallback`,
`postcss.config.cjs`, the `next/server` shim
- `@next/bundle-analyzer`, `raw-loader`, `postcss`,
`@tailwindcss/postcss` dev dependencies

Addresses
[FE-3106](https://linear.app/supabase/issue/FE-3106/move-page-bodies-into-route-files-and-delete-pages).

## To test

- Open an unknown URL – the 404 page renders with working "Head back"
- `/api/status-page` and `/api/scoped-access-token-permissions` on
platform – same JSON and `Cache-Control`
- Fonts (Inter, Manrope, Source Code Pro) still load

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-11-17 17:33:02 +09:00

67 lines
2.2 KiB
TypeScript

import { Link } from '@tanstack/react-router'
import { useTheme } from 'next-themes'
import { useEffect, useState } from 'react'
import { Button } from 'ui'
import { BASE_PATH } from '@/lib/constants'
export function NotFoundPage() {
const { resolvedTheme } = useTheme()
const [show404, setShow404] = useState<boolean>(false)
useEffect(() => {
setTimeout(() => {
setShow404(true)
}, 500)
}, [])
return (
<div className="relative mx-auto flex h-screen w-full flex-col items-center justify-center">
<div className="absolute top-0 mx-auto w-full max-w-7xl px-8 pt-6 sm:px-6 lg:px-8">
<nav className="relative flex items-center justify-between sm:h-10">
<div className="flex shrink-0 grow items-center lg:grow-0">
<div className="flex w-full items-center justify-between md:w-auto">
<Link to="/organizations">
<img
src={
resolvedTheme?.includes('dark')
? `${BASE_PATH}/img/supabase-dark.svg`
: `${BASE_PATH}/img/supabase-light.svg`
}
alt="supabase"
height={24}
width={120}
/>
</Link>
</div>
</div>
</nav>
</div>
<div
className={`absolute select-none opacity-5 filter transition duration-200 ${
show404 ? 'blur-xs' : 'blur-none'
}`}
>
<h1 style={{ fontSize: '28rem' }}>404</h1>
</div>
<div
className={`flex flex-col items-center justify-center space-y-6 transition ${
show404 ? 'opacity-100' : 'opacity-0'
}`}
>
<div className="flex w-[380px] flex-col items-center justify-center space-y-3 text-center">
<h3 className="text-xl">Looking for something? 🔍</h3>
<p className="text-foreground-light">
We couldn't find the page that you're looking for!
</p>
</div>
<div className="flex items-center space-x-4">
<Button variant="primary" asChild size="small">
<Link to="/organizations">Head back</Link>
</Button>
</div>
</div>
</div>
)
}