<?php
  /**
   * Common control library 0.1 for Conjuro.
   */
  return [
    new class("admin-title") extends Control{
      protected function renderControl($meta,$data) {
        echo $meta["title"];
      }
    },
    new class("admin-panel-buttons") extends Control{
      protected function renderControl($meta,$data) {
        foreach(m("Admin")->do("get-panel-links") as $lnk){
          c()->control("admin-panel-button")->render($lnk,$data);
        }
      }
    },
    new class("admin-panel-button") extends Control{
      protected function renderControl($meta,$data) {
        echo '<div class="admin-panel-button">';
        echo '<i class="admin-panel-button-icon fa-solid fa-'.$meta['icon'].'"></i>';
        echo '<a class="admin-panel-button-link" href="'.$meta["link"].'">'.$meta["title"].'</a>';
        echo '</div>';
      }
    }
  ];
?>