'use client'; import { Queries } from '@/api/queries'; import Loader from '@/components/Loader'; import { useContext, useEffect } from 'react'; import Option from '../Option'; import { v4 } from 'uuid'; import Button from '@/components/Button'; import StepsContext from '@/context/StepsContext'; import PresenceAnimator from '@/components/hox/PresenceAnimator'; const WindowOne = () => { const ctx = useContext(StepsContext); const { stepContext, propertyContext, data } = ctx; const { properties } = data; useEffect(() => { Queries.getProperties().then((data) => properties.setProperties(data)); }, []); if (!properties.properties) return ; return ( Eýeçiligiň görnüşini saýlaň! {properties.properties.data.map((option) => ( propertyContext.setProperty(id)} activeId={propertyContext.property} id={option.id} title={option.title} description={option.description} key={v4()} /> ))} stepContext.setStep(2)} name="Indiki" type="button" disabled={!propertyContext.property ? true : false} /> ); }; export default WindowOne;