refactor(events): move grid components from event-list to event-grid directory
Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import type { EventInfo } from '../types';
|
||||
import { EventCardView } from '../event-card.view';
|
||||
import { EventGridEmpty } from './event-grid.empty';
|
||||
|
||||
export function EventGridView({ events, footer }: { events: EventInfo[]; footer: (event: EventInfo) => React.ReactNode }) {
|
||||
return (
|
||||
<>
|
||||
{events.length > 0 && (
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-4">
|
||||
{events.map(event => (
|
||||
<EventCardView key={event.eventId} eventInfo={event} actionFooter={footer(event)} />
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
{events.length === 0 && <EventGridEmpty />}
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user