import { useCookies } from "react-cookie"; import CenteredContainer from "./ChildrenContainer"; import useFetchUser from "../utils/fetchUser"; import type React from "react"; import ApologyMessage from "./Attendance"; import { useState } from "react"; const Attendance: React.FC = () => { const { updateAttendance, getAttendance } = useFetchUser() const [attendance, setAttendance] = useState(null) const fetchAttendance = async () => { const is = await getAttendance() setAttendance(is) } fetchAttendance() const handleUpdate = async (status: boolean) => { await updateAttendance(status) window.location.reload(); } if (attendance == false) { return () } return ( <> {attendance == null && ( <>

Присоеденишься?

(Можно и потом ответить)

)} {attendance == true && ( <>

Круто! Ты с нами!

Если все же по разным обстоятельствам ты не сможешь/не захочешь, то всегда можно передумать

)} ) } function Greeting() { const [cookie] = useCookies(['userName']) const userName = cookie.userName; return ( <>

Приглашение на Новый год 2025-2026 🎄

{userName ? <>{userName} : <>Дорогая пятка!} ! 🦶

Приглашаем тебя отпраздновать предстоящий Новый Год 2025-2026 с нами в сосновой избе, в которой, ко всему прочему, будет праздноваться годовщина нашей жизни в ней! Наши двери открыты с 30.12.2025. Праздник обычно длится до 01.01.2025, но если тебе или твоим спутникам будет безумно плохо, то можно остаться и до второго числа.

) } const localStyles = { buttonOk: { margin: '0.5em', padding: '0.3em', backgroundColor: 'green' }, buttonNok: { margin: '0.5em', padding: '0.3em', backgroundColor: 'red' } } export default Greeting;