import _variants from "@/components/ui/button/_variants";
import { ValidateUserSchema } from "@/schemas/account/_validateuser";
import { FormBuilderElement } from "@/types/app-component-formbuilder";

type Field = FormBuilderElement<
ValidateUserSchema,
  typeof _variants
>;

export const getLoginFormFields = (dict: Dictionary) => {
  return [
    {
      type: "text",
      name: "user",
      label: dict.pages.auth.login.form.fields.user.label,
      placeholder: dict.pages.auth.login.form.fields.user.placeholder,
      required: true,
      errors: dict.pages.auth.login.form.fields.user.errors,
    },
    {
      type: "password",
      name: "password",
      label: dict.pages.auth.login.form.fields.password.label,
      placeholder: "********",
      required: true,
      errors: dict.pages.auth.login.form.fields.password.errors,
    },
    {
      type: "group",
      className: "w-full flex justify-start gap-2",
      fields: [
        {
          type: "submit",
          variant: "solid",
          color: "primary",
          label: dict.pages.general.sign_in,
        }
      ]
    }
  ] as Field[]
};
