import Protected from "@/components/Protected";
import SetPageTitle from "@/components/SetPageTitle";
import SetHeaderTitle from "@/components/SetHeaderTitle";
import BankEditClient from "@/components/banks/BankEditClient";

export const metadata = {
  title: "Master Data - Bank",
};

export default async function Page({ params }: { params: { id: string } }) {
  const { id } = params;

  return (
    <Protected>
      {/* document/tab title */}
      <SetPageTitle title={id === "new" ? "Create Bank" : "Edit Bank"} />
      {/* header title / breadcrumb */}
      <SetHeaderTitle
        title={
          id === "new"
            ? [{ label: "Banks", url: "/d/bank" }, { label: "Create" }]
            : [{ label: "Banks", url: "/d/bank" }, { label: "Edit" }]
        }
      />
      <div className="p-2">
        <BankEditClient id={id} />
      </div>
    </Protected>
  );
}
