export default function useLocal() {
  const appConfig = useRuntimeConfig().public;

  const { cookieConfig } = appConfig;

  function getUserFromCookie() {
    return useCookie("user", cookieConfig).value;
  }

  const drawer = useState("drawer", () => true);

  const { APP_ACCOUNT, APP_ORG } = appConfig;

  const apps = computed(() => {
    return [
      {
        title: "Account",
        icon: "mdi-account-group",
        link: APP_ACCOUNT as string,
        landingPage: "home",
      },
      {
        title: "Organization",
        icon: "mdi-account-group",
        link: APP_ORG as string,
        landingPage: "/",
      },
    ];
  });

  const headerSearch = useState("headerSearch", () => "");

  const natureOfBusiness = [
    {
      title: "Real Estate Developer",
      value: "real_estate_developer",
    },
    {
      title: "Property Management Agency",
      value: "property_management_agency",
    },
    { title: "Security Agency", value: "security_agency" },
    {
      title: "Mechanical and Electrical Services",
      value: "mechanical_electrical_services",
    },
    { title: "Cleaning Services", value: "cleaning_services" },
    { title: "Pest Control Services", value: "pest_control_services" },
    { title: "Landscaping Services", value: "landscaping_services" },
    { title: "Pool Maintenance Services", value: "pool_maintenance_services" },
  ];

  const natureOfBusinessV2 = [
    {
      title: "Property Management Services",
      value: "property_management_agency",
    },
    { title: "Security Agency", value: "security_agency" },
    { title: "Cleaning Services", value: "cleaning_services" },
    {
      title: "M&E Services",
      value: "mechanical_electrical_services",
    },
    { title: "Landscaping Services", value: "landscaping_services" },
    { title: "Pest Control Services", value: "pest_control_services" },
    { title: "Pool Maintenance Services", value: "pool_maintenance_services" },
  ];


  const landingPage = useCookie("landing-page", cookieConfig);

  const subjects = [
    {
      title: "Facilities",
      value: "Facilities",
      subtitle:
        "Shared amenities like gym, pool, BBQ pits, and function rooms.",
    },
    {
      title: "Building Facade",
      value: "Building Facade",
      subtitle:
        "Exterior walls, paint, cladding, signage, and overall appearance.",
    },
    {
      title: "Security",
      value: "Security",
      subtitle:
        "Guard services, access control, patrols, and visitor management.",
    },
    {
      title: "Cleaning",
      value: "Cleaning",
      subtitle:
        "Cleanliness of lobbies, corridors, lifts, bins, and common areas.",
    },
    {
      title: "Landscape",
      value: "Landscape",
      subtitle: "Condition of plants, lawns, trees, and garden maintenance.",
    },
    {
      title: "Pest Control",
      value: "Pest Control",
      subtitle:
        "Effectiveness of measures against insects, rodents, and pests.",
    },
    {
      title: "Water Features",
      value: "Water Features",
      subtitle:
        "Operation and cleanliness of fountains, ponds, and pools (non-swimming).",
    },
    {
      title: "Car Park",
      value: "Car Park",
      subtitle:
        "Parking availability, markings, lighting, and barrier systems.",
    },
    {
      title: "Lift",
      value: "Lift",
      subtitle:
        "Lift reliability, speed, cleanliness, ventilation, and downtime.",
    },
    {
      title: "Security Systems",
      value: "Security Systems",
      subtitle: "CCTV, intercoms, access cards, and gate/door sensors.",
    },
    {
      title: "Others",
      value: "Others",
      subtitle: "Any issues or feedback not covered by the categories above.",
    },
  ];

  return {
    cookieConfig,
    getUserFromCookie,
    drawer,
    apps,
    headerSearch,
    natureOfBusiness,
    natureOfBusinessV2,
    landingPage,
    subjects,
  };
}
