creavte venue inside create event
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import React from 'react'
|
||||
'use client'
|
||||
import React, { useState } from 'react'
|
||||
import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '../ui/card'
|
||||
import { Button } from '../ui/button'
|
||||
import Link from 'next/link'
|
||||
import EventInfoQuickView from '../EventInfoQuickView'
|
||||
import DialogWrapper from '../dialogs/DialogWrapper'
|
||||
import CreateEventForm from '../forms/CreateEventForm'
|
||||
|
||||
interface EventsProps {
|
||||
events: {
|
||||
@@ -20,32 +23,50 @@ interface EventsProps {
|
||||
}
|
||||
|
||||
export default function DashboardEvents({events}: EventsProps) {
|
||||
const [isDialogOpen, setIsDialogOpen] = useState(false)
|
||||
|
||||
return (
|
||||
<Card className='md:col-span-5 pb-3'>
|
||||
<CardHeader>
|
||||
<div className='flex justify-between items-center'>
|
||||
<CardTitle>
|
||||
Your Events
|
||||
</CardTitle>
|
||||
<Button
|
||||
className='bg-brand-primary-600 hover:bg-brand-primary-400'
|
||||
>
|
||||
Create Event
|
||||
</Button>
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className='grid md:grid-cols-3'>
|
||||
{events.map((item) => (
|
||||
<EventInfoQuickView key={item.id} {...item} />
|
||||
))}
|
||||
</div>
|
||||
</CardContent>
|
||||
<CardFooter>
|
||||
<div className='text-right w-full text-sm'>
|
||||
<Link href={'/events'}>View all</Link>
|
||||
</div>
|
||||
</CardFooter>
|
||||
</Card>
|
||||
<>
|
||||
<Card className='md:col-span-5 pb-3'>
|
||||
<CardHeader>
|
||||
<div className='flex justify-between items-center'>
|
||||
<CardTitle>
|
||||
Your Events
|
||||
</CardTitle>
|
||||
<Button
|
||||
className='bg-brand-primary-600 hover:bg-brand-primary-400'
|
||||
onClick={() => setIsDialogOpen(true)}
|
||||
>
|
||||
Create Event
|
||||
</Button>
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className='grid md:grid-cols-3 gap-3'>
|
||||
{events.map((item) => (
|
||||
<EventInfoQuickView key={item.id} {...item} />
|
||||
))}
|
||||
</div>
|
||||
</CardContent>
|
||||
<CardFooter>
|
||||
<div className='text-right w-full text-sm'>
|
||||
<Link href={'/events'}>View all</Link>
|
||||
</div>
|
||||
</CardFooter>
|
||||
</Card>
|
||||
<DialogWrapper
|
||||
open={isDialogOpen}
|
||||
onOpenChange={setIsDialogOpen}
|
||||
title="Create Event"
|
||||
description="Add new event"
|
||||
form={
|
||||
<CreateEventForm onSuccess={async () => {
|
||||
// await refreshEventData(event.id)
|
||||
setIsDialogOpen(false)
|
||||
}}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user