import { cloneElement, useMemo } from 'react' import Container from '@/components/shared/Container' import Card from '@/components/ui/Card' import Logo from '@/components/template/Logo' import type { ReactNode, ReactElement } from 'react' import type { CommonProps } from '@/@types/common' import { HiArrowLeft, HiCheck } from 'react-icons/hi' import { Avatar, Select } from '@/components/ui' import i18n, { dateLocales } from '@/locales' import { useStoreActions, useStoreState } from '@/store' import appConfig from '@/configs/app.config' import dayjs from 'dayjs' import { components } from 'react-select' import { ROUTES_ENUM } from '@/routes/route.constant' import { hasSubdomain } from '@/utils/subdomain' interface SimpleProps extends CommonProps { content?: ReactNode } const Simple = ({ children, content, ...rest }: SimpleProps) => { const { config } = useStoreState((state) => state.abpConfig) const { setLang } = useStoreActions((actions) => actions.locale) const currentCulture = config?.localization?.currentCulture?.cultureName const languageList = config?.localization.languages const languageOptions = useMemo(() => { return ( languageList?.map((lang) => ({ label: lang.displayName, value: lang.cultureName, cultureName: lang.cultureName, imgPath: `/img/countries/${lang.cultureName}.png`, })) || [] ) }, [languageList]) const onLanguageSelect = (cultureName = appConfig.locale) => { const dispatchLang = () => { i18n.changeLanguage(cultureName) setLang(cultureName) } if (dateLocales[cultureName]) { dateLocales[cultureName]() .then(() => { dayjs.locale(cultureName) dispatchLang() }) .catch(() => { dispatchLang() }) } else { dispatchLang() } } const CustomSelectOption = ({ innerProps, label, data, isSelected }: any) => { return (