                          :accept-text "Delete"})))]]}]]
 
      [:div.library-top-menu-actions
-      [:a.library-top-menu-actions-delete
-       {:on-click #(when on-delete-selected (on-delete-selected))}
-       i/trash]
+      (when on-delete-selected 
+        [:a.library-top-menu-actions-delete
+         {:on-click on-delete-selected}
+         i/trash])
 
       (if (= section :palettes)
         [:button.btn-secondary.btn-small

          :library-id library-id
          :team-id team-id
          :on-delete-selected
          (fn []
            (when (-> @state :selected count (> 0))
              (modal/show!
               confirm-dialog
               {:on-accept #(st/emit! (dlib/batch-delete-item section library-id (:selected @state)))
                :message (str "Are you sure you want to delete " (-> @state :selected count) " items?")
                :accept-text "Delete"})
              )
            )
          }]
        [:*
         (if (> (count items) 0)
           [:div.library-page-cards-container

                  :style {:display "none"}}]])]]))

(mf/defc library-icon-card
  [{:keys [item on-select on-unselect on-delete]}]
  (let [{:keys [id name url content metadata library-id modified-at]} item
        locale (i18n/use-locale)
        state (mf/use-state {:is-open false :selected false})
        time (dt/timeago modified-at {:locale locale})
        handle-change (fn []
                        (swap! state update :selected not)
