"use client";

import { createExperienceListPage } from "@/modules/experience/components/ExperienceListCrudPage";
import { experienceApi } from "@/modules/experience/services/experience-api";

export const LocaleProfilesPage = createExperienceListPage({
  title: "پروفایل زبان",
  breadcrumb: "پروفایل زبان",
  resourceKey: "localeProfiles",
  permission: "experience.locale_profiles.view",
  api: experienceApi.localeProfiles,
  columns: [
    { key: "code", header: "کد" },
    { key: "name", header: "نام" },
    { key: "language", header: "زبان" },
    { key: "status", header: "وضعیت", type: "status" },
    { key: "created_at", header: "ایجاد", type: "datetime" },
  ],
  createFields: [
    { name: "workspace_id", label: "فضای کاری", type: "workspace", required: true, createOnly: true },
    { name: "code", label: "کد", required: true },
    { name: "name", label: "نام", required: true },
    { name: "language", label: "زبان", placeholder: "fa", required: true },
    {
      name: "text_direction",
      label: "جهت",
      type: "select",
      options: [
        { value: "rtl", label: "راست‌به‌چپ" },
        { value: "ltr", label: "چپ‌به‌راست" },
      ],
    },
    {
      name: "status",
      label: "وضعیت",
      type: "select",
      options: [
        { value: "draft", label: "پیش‌نویس" },
        { value: "active", label: "فعال" },
      ],
    },
  ],
});

export default LocaleProfilesPage;
