import { ChevronRightIcon } from '@heroicons/react/20/solid'

const people = [
  {
    name: 'JSON Alexander',
    email: 'json.alexander@likewise.dev',
    role: 'Co-Founder / CEO',
    imageUrl:
      'https://placehold.co/256x256/ecdfd8/120D0A?font=poppins&text=Avatar',
    href: '#',
    lastSeen: '3h ago',
    lastSeenDateTime: '2023-01-23T13:23Z',
  },
  {
    name: 'Human McPersonface',
    email: 'square.pusher@likewise.dev',
    role: 'Co-Founder / CTO',
    imageUrl:
      'https://placehold.co/256x256/ecdfd8/120D0A?font=poppins&text=Avatar',
    href: '#',
    lastSeen: '3h ago',
    lastSeenDateTime: '2023-01-23T13:23Z',
  },
  {
    name: 'Git McRepositron',
    email: 'git.mcrepositron@likewise.dev',
    role: 'Business Relations',
    imageUrl:
      'https://placehold.co/256x256/ecdfd8/120D0A?font=poppins&text=Avatar',
    href: '#',
    lastSeen: null,
  },
  {
    name: 'Kernel Compiler',
    email: 'kernel.compiler@likewise.dev',
    role: 'Front-end Developer',
    imageUrl:
      'https://placehold.co/256x256/ecdfd8/120D0A?font=poppins&text=Avatar',
    href: '#',
    lastSeen: '3h ago',
    lastSeenDateTime: '2023-01-23T13:23Z',
  },
  {
    name: 'Syntaxy Highlightor',
    email: 'syntaxy.highlightor@likewise.dev',
    role: 'Designer',
    imageUrl:
      'https://placehold.co/256x256/ecdfd8/120D0A?font=poppins&text=Avatar',
    href: '#',
    lastSeen: '3h ago',
    lastSeenDateTime: '2023-01-23T13:23Z',
  },
  {
    name: 'Square Pusher',
    email: 'square.pusher@likewise.dev',
    role: 'Director of Product',
    imageUrl:
      'https://placehold.co/256x256/ecdfd8/120D0A?font=poppins&text=Avatar',
    href: '#',
    lastSeen: null,
  },
]

export default function Example() {
  return (
    <ul role="list" className="divide-y divide-gray-100 dark:divide-white/5">
      {people.map((person) => (
        <li
          key={person.email}
          className="relative flex justify-between gap-x-6 px-4 py-5 hover:bg-gray-50 sm:px-6 lg:px-8 dark:hover:bg-white/2.5"
        >
          <div className="flex min-w-0 gap-x-4">
            <img
              alt=""
              src={person.imageUrl}
              className="size-12 flex-none rounded-full bg-gray-50 dark:bg-gray-800 dark:outline dark:-outline-offset-1 dark:outline-white/10"
            />
            <div className="min-w-0 flex-auto">
              <p className="text-sm/6 font-semibold text-gray-900 dark:text-white">
                <a href={person.href}>
                  <span className="absolute inset-x-0 -top-px bottom-0" />
                  {person.name}
                </a>
              </p>
              <p className="mt-1 flex text-xs/5 text-gray-500 dark:text-gray-400">
                <a href={`mailto:${person.email}`} className="relative truncate hover:underline">
                  {person.email}
                </a>
              </p>
            </div>
          </div>
          <div className="flex shrink-0 items-center gap-x-4">
            <div className="hidden sm:flex sm:flex-col sm:items-end">
              <p className="text-sm/6 text-gray-900 dark:text-white">{person.role}</p>
              {person.lastSeen ? (
                <p className="mt-1 text-xs/5 text-gray-500 dark:text-gray-400">
                  Last seen <time dateTime={person.lastSeenDateTime}>{person.lastSeen}</time>
                </p>
              ) : (
                <div className="mt-1 flex items-center gap-x-1.5">
                  <div className="flex-none rounded-full bg-emerald-500/20 p-1 dark:bg-emerald-500/30">
                    <div className="size-1.5 rounded-full bg-emerald-500" />
                  </div>
                  <p className="text-xs/5 text-gray-500 dark:text-gray-400">Online</p>
                </div>
              )}
            </div>
            <ChevronRightIcon aria-hidden="true" className="size-5 flex-none text-gray-400 dark:text-gray-500" />
          </div>
        </li>
      ))}
    </ul>
  )
}
