             [re-frame.core :as rf]))
 
 (rf/reg-event-fx
-  ::vubis-file
+  ::extract-productions
   (fn [{:keys [db]} [_ js-file-value]]
     (let [form-data (doto (js/FormData.)
                       (.append "file" js-file-value "filename.txt"))]

     [:td description]
     [:td library_number]
     [:td source_publisher]
     [:td (tf/unparse (tf/formatters :date) source_date)]]))

(defn- productions []
  [:<>

          (notifications/clear-button-state :vubis :vubis-file)))))

(rf/reg-event-db
 ::ack-extract-failure
 (fn [db [_ response]]
   (-> db
       (assoc-in [:errors :version] (or (get-in response [:response :status-text])
                                        (get response :status-text)))
       (notifications/clear-button-state :vubis :vubis-file))))

(rf/reg-event-fx
  ::save-production
  (fn [{:keys [db]} [_ id]]
    (let [production (get-in db [:productions :vubis id])
          cleaned (dissoc production :uuid)]
      {:db (notifications/set-button-state db id :vubis)
       :http-xhrio
       (as-transit
        {:method          :put
         :headers         (auth/auth-header db)
         :uri             "/api/productions"
         :params          cleaned
         :on-success      [::ack-save id]
         :on-failure      [::ack-failure id :vubis]})})))

(rf/reg-event-db
  ::ack-save
  (fn [db [_ id]]
    (-> db
        (update-in [:productions :vubis] dissoc id)
        (notifications/clear-button-state id :vubis))))

(rf/reg-event-db
 ::ack-failure
 (fn [db [_ id request-type response]]
   (-> db
       (assoc-in [:errors request-type] (or (get-in response [:response :status-text])
                                            (get response :status-text)))
       (notifications/clear-button-state id request-type))))

(rf/reg-event-fx
  ::save-all-productions
  (fn [{:keys [db]} _]
    (let [ids (keys (get-in db [:productions :vubis]))]
      {:dispatch-n (map (fn [id] [::save-production id]) ids)})))

(rf/reg-event-db
  ::ignore-production
  (fn [db [_ uuid]]
    (update-in db [:productions :vubis] dissoc uuid)))

(rf/reg-event-db
  ::ignore-all-productions
  (fn [db _]
    (update-in db [:productions] dissoc :vubis)))

(rf/reg-sub
 ::productions
