Skip to content
Snippets Groups Projects
Commit 566423a7 authored by LarsLolies's avatar LarsLolies
Browse files

bugfix: js fs error, not fixed yet

parent 9fa0480c
Branches
No related tags found
No related merge requests found
File added
File added
File added
File added
......@@ -61,9 +61,9 @@ export function EventWidget({ selectedDate }: calendarDate) {
*/
export function EventWidget({ selectedDate }: calendarDate) {
// const [events, setEvents] = useState<any>(undefined)
const [events, setEvents] = useState<any>(undefined)
/* useEffect(() => {
useEffect(() => {
async function fetchEvents() {
if (selectedDate !== undefined) {
const eventsData = await getEventsByDate(selectedDate)
......@@ -72,25 +72,37 @@ export function EventWidget({ selectedDate }: calendarDate) {
}
fetchEvents()
}, [])
*/
if (!selectedDate) {
return null // If no selectedDate, return null
}
return (
<div className="w-64 h-[256px]">
<Carousel slideInterval={1000}>
<img src="https://flowbite.com/docs/images/carousel/carousel-1.svg" alt="Slide 1" />
<img src="https://flowbite.com/docs/images/carousel/carousel-2.svg" alt="Slide 2" />
<img src="https://flowbite.com/docs/images/carousel/carousel-3.svg" alt="Slide 3" />
<img src="https://flowbite.com/docs/images/carousel/carousel-4.svg" alt="Slide 4" />
<img src="https://flowbite.com/docs/images/carousel/carousel-5.svg" alt="Slide 5" />
</Carousel>
</div>
)
return (
<div className="w-64 h-[256px]">
{events && events.length > 0 ? (
<Carousel slideInterval={10000}>
{events.map((event) => (
<div key={event.id} className="flex flex-col items-center justify-center h-full bg-gray-100">
<h3 className="text-lg font-bold">{event.title}</h3>
<p className="text-sm text-gray-600">{event.description}</p>
</div>
))}
</Carousel>
) : (
<div className="flex items-center justify-center h-full bg-gray-100">
<p className="text-gray-500">Keine Events für dieses Datum.</p>
</div>
)}
</div>
);
}
/*
async function getEventsByDate(selectedDate: Date) {
const payload = await getPayload({ config })
......@@ -126,7 +138,7 @@ async function getEventsByDate(selectedDate: Date) {
return filteredEvents
}
*/
/*
async function getEventsByDate(selectedDate: Date) {
......@@ -157,11 +169,13 @@ async function getEventsByDate(selectedDate: Date) {
console.error(error)
}
}
*/
*/
// testbereich
/*
interface DateDisplayProps {
selectedDate: Date | undefined
}
......@@ -177,4 +191,4 @@ export function DateDisplay({ selectedDate }: DateDisplayProps) {
)
}
*/
'use client'
//'use client'
import { useState } from 'react'
import { CustomDatePicker } from './calendar/calendar_desktop'
import EventCardTag from './calendar/event_cards'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment