import styles from "./styles.module.scss"

type AdminEditButtonProps = {
  collection: string,
  id?: string,
  isAuthenticated: boolean,
}

export const AdminMenu = ({ collection, id, isAuthenticated}: AdminEditButtonProps) => {

  if(!isAuthenticated)
    return null;

  return (
    <div className={styles.menu}>
      <a href={`/admin`}>Admin</a>
      <a href={`/admin/collections/${collection}/create`}>Neu erstellen</a>
      {id &&
        <a href={`/admin/collections/${collection}/${id}`}>Bearbeiten</a>

      }
      <a href={`/admin/logout`}>Abmelden</a>
    </div>

  )
}