editRoleForm = ({ url, current_role, roles, req }) =>
  form(
    {
      action: url,
      method: "post",
      onchange: "saveAndContinue(this)",
    },
    csrfField(req),
    select(
      {
        name: "role",
        class: "w-unset form-select form-select-sm",
      },
      roles.map((role) =>
        option(
          {
            value: role.id,
            ...(current_role === role.id && { selected: true }),
          },
          text(role.role)
        )
      )
    )
  )
Edit Role form (for admin)
@param {object} opts
@param {string} opts.url
@param {Role} opts.current_role
@param {Role[]} opts.roles
@param {object} opts.req
@returns {Form}