import { getUsers } from '@/app/actions/admin'
import { CreateUserDialog } from '../create-user-dialog'
import { UserList } from '../user-list'
import { Plus } from 'lucide-react'
import { Button } from '@/components/ui/button'

export default async function AdminUsersPage() {
  const users = await getUsers()

  return (
    <div className="space-y-6">
      <div className="flex justify-between items-center">
        <div>
          <h1 className="text-3xl font-bold text-gray-900 dark:text-white">
            Users
          </h1>
          <p className="text-gray-600 dark:text-gray-400 mt-1">
            Manage application users and permissions
          </p>
        </div>
        <CreateUserDialog />
      </div>

      <div className="bg-card rounded-lg shadow-sm overflow-hidden border border-border">
        <UserList initialUsers={users} />
      </div>
    </div>
  )
}
