- invites = dossier.invites.load = render Dropdown::MenuComponent.new(wrapper: :div, wrapper_options: {class: 'invite-user-action'}, button_options: { class: ['fr-btn--secondary'] }, menu_options: { id: 'invite-content' }) do |menu| = 'lab' - menu.with_button_inner_html do = dsfr_icon('fr-icon-user-add-fill', :sm, :mr) - if invites.present? = t('views.invites.dropdown.view_invited_people') %span.badge= invites.size - else - if dossier.read_only? = t('views.invites.dropdown.invite_to_view') - else = t('views.invites.dropdown.invite_to_edit') - menu.with_form do = render partial: "invites/form", locals: { dossier: dossier, invites: invites, morphing: morphing }