/* eslint-disable @typescript-eslint/no-explicit-any */
// components/ProfileBasicFields.tsx
import React from "react";
import RoundedInput from "@/components/elements/RoundedInput";
import SelectBox from "@/components/elements/SelectBox";
import { IAdvertisingCategory } from "@/types/types";

interface ProfileBasicFieldsProps {
  formik: any;
  categories: IAdvertisingCategory[];
}

const ProfileBasicFields: React.FC<ProfileBasicFieldsProps> = ({
  formik,
  categories,
}) => {
  return (
    <>
      <RoundedInput
        className="max-w-full"
        type="text"
        placeholder="عنوان"
        {...formik.getFieldProps("vitrine_name")}
      />
      <SelectBox
        className="max-w-full mt-2"
        value={formik.values.categoryId}
        onChange={(e) =>
          formik.setFieldValue("categoryId", e.target.value)
        }
      >
        <option disabled value="">
          دسته بندی
        </option>
        {categories.map((item: IAdvertisingCategory) => (
          <option key={item._id} value={item.title}>
            {item.title}
          </option>
        ))}
      </SelectBox>
      <textarea
        className="w-full p-4 mt-2 h-24 rounded-3xl border border-border-primary-light dark:border-border-primary-dark bg-secondary-light dark:bg-secondary-dark font-medium"
        placeholder="درباره ما"
        {...formik.getFieldProps("about_us")}
      ></textarea>
    </>
  );
};

export default ProfileBasicFields;
