"use client";

import { createDeliveryListPage } from "@/modules/delivery/components/DeliveryListCrudPage";
import { deliveryApi } from "@/modules/delivery/services/delivery-api";

export const OrganizationsPage = createDeliveryListPage({
  title: "سازمان‌ها",
  breadcrumb: "سازمان‌ها",
  resourceKey: "organizations",
  permission: "delivery.organizations.view",
  api: deliveryApi.organizations,
  columns: [
    { key: "code", header: "کد" },
    { key: "name", header: "نام" },
    { key: "status", header: "وضعیت", type: "status" },
    { key: "created_at", header: "ایجاد", type: "datetime" },
  ],
  createFields: [
    { name: "code", label: "کد", required: true },
    { name: "name", label: "نام", required: true },
    { name: "status", label: "وضعیت", type: "select", options: [
      { value: "draft", label: "پیش‌نویس" },
      { value: "active", label: "فعال" },
    ]},
  ],
});

export default OrganizationsPage;
