import type { Metadata } from "next";

import GroupPolicyEditor from "@/components/travel-policy/GroupPolicyEditor";

export const metadata: Metadata = {
  title: "Group travel policy",
};

/**
 * One group's rules. `groupId` is the real `business_groups.id` as a string —
 * not a slug: a slug would need a second lookup and would break the moment a
 * group was renamed, and the design's own `#/group/<slug>` routing only works
 * because its data never leaves the browser.
 *
 * `params` is a Promise in Next 15+, hence the await.
 */
export default async function Page({ params }: { params: Promise<{ groupId: string }> }) {
  const { groupId } = await params;
  return <GroupPolicyEditor groupId={groupId} />;
}
