From cd6467183d88915ce419336028d74163c852ed9b Mon Sep 17 00:00:00 2001 From: Antoine M Date: Tue, 13 Feb 2024 19:21:03 +0100 Subject: [PATCH] introducing special profile select component --- src/components/ui/ProfileSelect.jsx | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/components/ui/ProfileSelect.jsx diff --git a/src/components/ui/ProfileSelect.jsx b/src/components/ui/ProfileSelect.jsx new file mode 100644 index 0000000..b59f9d7 --- /dev/null +++ b/src/components/ui/ProfileSelect.jsx @@ -0,0 +1,35 @@ +import React, { useState } from "react"; +import { v4 as uuidv4 } from "uuid"; +import { useUser } from "../../hooks/useUser"; + +export default function CountrySelect({ options }) { + const [isSubmenuOpen, setIsSubmenuOpen] = useState(false); + const { profile, changeProfile } = useUser(); + + function handleShowHideSubmenu() { + setIsSubmenuOpen(!isSubmenuOpen); + } + + function handleChangeProfile() { + changeProfile("subcontractor_employee"); + } + + if (!profile) return
Loading...
; + + const selectOptions = Object.keys(options).map((key) => ( +
  • handleChangeProfile()}> + {options[key]} +
  • + )); + + return ( +
    + + +
    + ); +}