File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
src/components/pacto/body Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 11import { formatDate } from "@/utils/format"
22import { fetchEventsProjectId } from "@/utils/get-data"
33import DeleteEventButton from "@/components/pacto/body/deleteEvent"
4+ import NewProjectEvent from "@/components/pacto/body/newEvent"
45
56export default async function HojaBody ( { project } ) {
67 const events = await fetchEventsProjectId ( project . _id )
78 return < >
89 < div className = "hoja-de-ruta-wrapper" >
910 < div className = "my-4" >
10-
1111 < h1 className = " is-size-3 has-text-primary mb-0" > Hoja de Ruta de las asambleas</ h1 >
1212 < span className = "has-text-weight-light is-italic is-size-4 has-text-primary" > * Roteiro das Assembleias</ span >
1313 </ div >
14+ < div className = "buttons" >
15+ < NewProjectEvent project = { project } />
16+ </ div >
1417 < p className = "mb-0 has-text-weight-bold" > Ordenado de más reciente a más antiguo</ p >
1518 < span className = "has-text-weight-light is-italic is-size-7" > *Ordenado do mais recente ao mais antigo</ span >
1619
17- < div className = "events" >
20+ < div className = "events mt-4 " >
1821 { events . events . map ( event => < div key = { event . _id } className = "columns event is-flex" >
1922 < div className = "py-5 column is-flex-grow-0" >
2023 < div className = "date is-flex is-relative is-justify-content-space-between" >
Original file line number Diff line number Diff line change 1+ 'use client'
2+ import { useAuthContext } from "@/context/auth-context" ;
3+ import Link from "next/link" ;
4+ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" ;
5+ import { faPlus } from "@fortawesome/free-solid-svg-icons" ;
6+
7+ export default function NewProjectEvent ( { project} ) {
8+ const { user } = useAuthContext ( )
9+ if ( user && ( user . role === 'admin' || project . author . _id === user . _id ) ) return (
10+ < Link href = { `/pacto/${ project . slug } /hoja-de-ruta/nuevo` } className = "button is-rounded is-outlined is-black" >
11+ < FontAwesomeIcon icon = { faPlus } /> Nuevo evento</ Link > )
12+ }
13+
You can’t perform that action at this time.
0 commit comments