import { Paper } from "@mui/material"; import { countryStore, languageStore } from "@shared"; import { observer } from "mobx-react-lite"; import { ArrowLeft } from "lucide-react"; import { useEffect } from "react"; import { useNavigate, useParams } from "react-router-dom"; import { LanguageSwitcher } from "@widgets"; export const CountryPreviewPage = observer(() => { const { id } = useParams(); const { getCountry, country, setEditCountryData } = countryStore; const navigate = useNavigate(); const { language } = languageStore; useEffect(() => { (async () => { if (id) { const ruData = await getCountry(id as string, "ru"); const enData = await getCountry(id as string, "en"); const zhData = await getCountry(id as string, "zh"); setEditCountryData(ruData.name, "ru"); setEditCountryData(enData.name, "en"); setEditCountryData(zhData.name, "zh"); } })(); }, [id]); return (
{/*
*/}
{country[id!]?.[language] && (

Название

{country[id!]?.ru?.name}

)}
); });