'use client';
import { EventoProvider } from '@/context/evento/evento-context';
import { useParams } from 'next/navigation';
import React from 'react';

type Params = {
  id_evento: string;
};

export default function Layout({ children }: { children: React.ReactNode }) {
  const params = useParams<Params>();

  if (!params.id_evento) {
    return <div>Error: ID de evento no encontrado</div>;
  }

  return (
    <EventoProvider id_evento={params.id_evento}>{children}</EventoProvider>
  );
}
