const ChangeCapitalize = (ref) => {
  if (ref.current) {
    ref.current.value = ref.current.value
      .toLowerCase() // Ensure all text is lowercase first
      .split(' ') // Split the text into words by spaces
      .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) // Capitalize the first letter of each word
      .join(' ') // Join the words back with spaces
  }
}

export default ChangeCapitalize
