diff --git a/src/components/ui/ProfileSelect.jsx b/src/components/ui/ProfileSelect.jsx index b59f9d7..aa39a15 100644 --- a/src/components/ui/ProfileSelect.jsx +++ b/src/components/ui/ProfileSelect.jsx @@ -1,11 +1,16 @@ import React, { useState } from "react"; import { v4 as uuidv4 } from "uuid"; import { useUser } from "../../hooks/useUser"; +import translationsJSON from "../../data/profile.json"; export default function CountrySelect({ options }) { const [isSubmenuOpen, setIsSubmenuOpen] = useState(false); const { profile, changeProfile } = useUser(); + const { language } = useUser(); + const languageTranslationExists = translationsJSON.hasOwnProperty(language); + const screenTranslations = languageTranslationExists ? translationsJSON[language] : translationsJSON["en"]; + function handleShowHideSubmenu() { setIsSubmenuOpen(!isSubmenuOpen); } @@ -14,21 +19,25 @@ export default function CountrySelect({ options }) { changeProfile("subcontractor_employee"); } - if (!profile) return
Loading...
; + console.log(screenTranslations); - const selectOptions = Object.keys(options).map((key) => ( -
  • handleChangeProfile()}> - {options[key]} -
  • - )); + // console.log(options); return ( -
    - -