filter_ui <- function(id) {
  ns <- NS(id)
  tabPanel(
    title = "Filter",
    value = ns("tab"),

    tags$br(),
    ## Load data ------------------------------------------------------------

    h3("Load data"),
    uiOutput(ns("filter_load")),
    tags$hr(),

    ## filter ----------------------------------------------------------------

    h3("Filter data if necessary"),
    tags$hr(),
    uiOutput(ns("filters_ui")),
    uiOutput(ns("filter_codeui")),
    actionButton(ns("add_filter"), "➕ Add Filter"),
    actionButton(ns("filter_button"), "Apply Filter"),

    tags$hr(),

    ## finish up: download and continue to next tab ------------------------
    fluidRow(
      column(
        width = 6,
        downloadButton(ns("download_filter"),
                       label = "Download Filtered Data")
      ),
      column(
        width = 6,
        actionButton(ns("go_filter_aggregation"),
                     "Continue with filtered data to aggregation")
      )
    )
  )
}

### END
