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 '@/proxy/common' import { FaArrowLeft, FaCheck } from 'react-icons/fa' import { Avatar, Select } from '@/components/ui' import { useStoreActions, useStoreState } from '@/store' import appConfig from '@/proxy/configs/app.config' import { components } from 'react-select' import { ROUTES_ENUM } from '@/routes/route.constant' import { hasSubdomain } from '@/utils/subdomain' import useDarkMode from '@/utils/hooks/useDarkmode' 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 [isDarkMode] = useDarkMode() 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]) // The store is the single entry point: `useLocale` runs above every layout and // owns the dayjs locale, the timezone and ``. const onLanguageSelect = (cultureName = appConfig.locale) => { setLang(cultureName) } const CustomSelectOption = ({ innerProps, data, isSelected }: any) => { return (
{isSelected && }
) } const CustomSingleValue = ({ data, ...props }: any) => { return (
) } return (
{!hasSubdomain() && ( )}