AdminRoutefunction
import { AdminRoute } from '@mortar-kit/admin/router'
function AdminRoute(props: AdminRouteProps): Element<Admin> as a route of a @solidjs/router app: its location lives in the
URL's search parameters, and leaving a document with unsaved changes
(a link, back/forward, switching documents) asks first. A save still in
flight is waited for before leaving, so the next page reads what was saved.
Parameters
props: AdminRouteProps
Returns
Element
Example
// src/routes/admin.tsx, routed at /admin
export default function AdminPage() {
return <AdminRoute bricks={bricks} collections={collections} content={adminContent} previewUrl="/admin/preview" />;
}