I'm trying to make this component into a generic component that can be used anywhere:

(defn quote-actions [sales-contractor? _ id {{:keys [status sales-order-file-url editable] :as quote} :raw-data idx :idx}]
  (ra/with-let [is-open                   (ra/atom false)]
    [ui/dropdown-button {:key       "dropdown"
                         :is-open   @is-open
                         :direction "down"
                         :toggle    #(reset! is-open (not @is-open))
                         :style     {:height "44px"}}
     [ui/dropdown-toggle {:key "dropdown-toggle" :style {:width 150} :caret true
                          :color (dropdown-color-logic status sales-order-file-url)}
      "Quote Actions"]
     [ui/dropdown-menu {:key "dropdown-menu" :class "dropdown-menu-right"}
      
      [ui/dropdown-item {:key      "approve"
                         :disabled @(subscribe [:quote.job/approve-button-disabled? idx])
                         :on-click #(do (dispatch [:quote.job/open-comment-modal id :approved])
                                        (reset! is-open false))}
       [:div.d-flex 
        "Approve" 
        (when (and (not (= status :approved)) @(subscribe [:quote.job/approved-quotes-exist?]))
          [ui/with-popover
           [:i.fas.fa-question-circle.fa-md.ml-2 {:id (str "approved-existing-" id)}]
           "An approved quote already exists. If you wish to approve this quote, reject that one first."])]]
      
      [ui/dropdown-item {:key      "reject"
                         :disabled @(subscribe [:quote.job/reject-button-disabled? idx])
                         :on-click #(do (dispatch [:quote.job/open-comment-modal id :rejected])
                                        (reset! is-open false))}
       "Reject"] 
      [ui/dropdown-item {:key      "sales-order"
                         :disabled (or (not (= status :approved))
                                       (not (:sales-orders @(subscribe [:organisation/branding-themes])))
                                                            ;; Old quotes which don't store quote data cannot make sales orders
                                       (not editable))
                         :on-click #(dispatch [:quote.job/api-create-sales-order id])}
       [:div.d-flex
        (if sales-order-file-url
          "Recreate Sales Order"
          "Create Sales Order")
        [ui/with-popover
         [:i.fas.fa-question-circle.fa-md.ml-2 {:id (str "sales-order-comment-" id)}]
         (if-not (= status :approved)
           "In order to create a sales order, the quote needs to be approved first."
           (if-not editable
             "This quote was created by an older release and so can not have sales orders."
             [:p "Please make sure the sales order branding theme is set up in the "
              [:a {:href   "/organisation/config"
                   :target "#"}
               "organisation settings"]
              " first. Sales orders are for distribution to people who don't need to see the financial information on a quote, such as employees who will be picking the items."]))]]]
      (when-not sales-contractor?
        [:div
         [:hr]
         [ui/dropdown-item {:key      "delete"
                            :on-click #(dispatch [::events/api-delete-quote id])}
          "Delete"]])]]))

I got about this far:

(defn dropdown-menu-button
  "Standard dropdown menu button. Takes a config map.
   Required:
   :key
   :title
   :items"
  [config]
  (ra/with-let [is-open                   (ra/atom false)]
    [components/dropdown-button {:key       (when-not (:key config)   (:title config))
                         :is-open   @is-open
                         :toggle    #(reset! is-open (not @is-open))
                         :style     (when-not (:style config) {:height "44px"})}
     [components/dropdown-toggle
      {:key "dropdown-toggle" :style (when-not (:width config) {:width 150}) :caret (when-not (:caret config) true)
       :color (when-not (:color config) "primary")} 
      (:title config)]
     [components/dropdown-menu {:key "dropdown-menu" :class "dropdown-menu-right"}
      (:items config)]]))

but my coworker told me: instead of having when when when I should just have a function that's like (resolve-default-styles style) and compare the styles to a default map of styling

Can you do this for me?