feat(housekeeping): unify complete rebuild in gated preview
This commit is contained in:
1 parent
4ad007d241
commit
43470ebf82
402 files changed
+78313
-1663
No files matched your search
@@ -0,0 +1,47 @@
|
||||
import { PERMS } from "@/lib/permission-slugs";
|
||||
import type { HousekeepingPageInput } from "../../../route-handlers";
|
||||
import { hotelQuery } from "../queries/rooms";
|
||||
import { HotelCommandForm } from "./hotel-command-form";
|
||||
import {
|
||||
HotelPageFrame,
|
||||
type HotelPageProps,
|
||||
parseHotelListInput,
|
||||
} from "./hotel-page-frame";
|
||||
|
||||
export function HotelRoomsPage(props: HotelPageProps) {
|
||||
return (
|
||||
<HotelPageFrame
|
||||
title="Rooms"
|
||||
description="Search and operate hotel rooms."
|
||||
result={props.result}
|
||||
forms={
|
||||
props.context.has(PERMS.ROOMS_EDIT) ? (
|
||||
<HotelCommandForm
|
||||
commandId="hotel.rooms.update"
|
||||
buttonLabel="Save room"
|
||||
input={{}}
|
||||
fields={[
|
||||
{ name: "id", label: "Room ID", type: "number", required: true },
|
||||
{ name: "name", label: "Name", type: "text", required: true },
|
||||
]}
|
||||
/>
|
||||
) : null
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export async function renderHotelRoomsPage(input: HousekeepingPageInput) {
|
||||
const result = await hotelQuery.run(input.context, {
|
||||
routeId: "hotel.rooms",
|
||||
params: input.match.params,
|
||||
list: parseHotelListInput(input.searchParams ?? {}),
|
||||
});
|
||||
return (
|
||||
<HotelRoomsPage
|
||||
context={input.context}
|
||||
result={result}
|
||||
routeId="hotel.rooms"
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user