export  const SideBarLogoUrl = "/logo3.png";
export const UserImageURL = "data:image/jpeg;base64,[encoded data, 8964 characters]"
export  const LoginBg = "../Layout/LoginBg.jpg";

export const  BaseURL = "https://64df594871c3335b25827869.mockapi.io/"



export const convert_data_to_select = (array = []) => {
    if (typeof array === 'undefined' || !Array.isArray(array)) {
      throw new Error("Expected an array argument")
    }
    let new_array :any = []
    array.map((e:any) => new_array.push({ label: e?.name, value: e?.id }))

    return new_array
  }

 export const FakeSelectData :any = [
    {
      name : "mhmad",
      id : 1
    },
    {
      name : "karim",
      id : 2
    },
    {
      name : "suliman",
      id : 3
    },
    {
      name : "ibrahim",
      id : 4
    },
]


export  const hasValue = (fieldValue: any, name: string): boolean => {
  if (Array.isArray(fieldValue)) {
    return fieldValue.length > 0;
  } else if (typeof fieldValue === "object") {
    return Object.keys(fieldValue).length > 0;
  } else {
   
    return !!fieldValue;
  }
};