Repository: apache/airflow
File: airflow-core/src/airflow/ui/src/constants/filterConfigs.tsx (TypeScript)

Code before:
      icon: <MdDateRange />,
      label: translate("common:logicalDate"),
      startKey: SearchParamsKeys.AFTER,
      type: FilterTypes.DATERANGE,
    },
    [SearchParamsKeys.EVENT_TYPE]: {
      label: translate("browse:auditLog.filters.eventType"),
      type: FilterTypes.TEXT,
    },
    [SearchParamsKeys.EXECUTOR_CLASS]: {
      hotkeyDisabled: true,
      icon: <MdBuild />,
      label: translate("admin:jobs.columns.executorClass"),
      type: FilterTypes.TEXT,
    },
    [SearchParamsKeys.HOSTNAME]: {
      hotkeyDisabled: true,
      icon: <MdComputer />,
      label: translate("admin:jobs.columns.hostname"),
      type: FilterTypes.TEXT,
    },
    [SearchParamsKeys.JOB_STATE]: {
      icon: <MdCheckCircle />,
      label: translate("common:state"),
      options: jobStateOptions.items.map((option) => ({
        label: option.value === "all" ? translate(option.label) : translate(option.label),
        value: option.value === "all" ? "" : option.value,
      })),
      type: FilterTypes.SELECT,
    },
    [SearchParamsKeys.JOB_TYPE]: {
      icon: <MdBuild />,
      label: translate("admin:jobs.columns.jobType"),
      options: jobTypeOptions.items.map((option) => ({
        label: translate(option.label),
        value: option.value === "all" ? "" : option.value,
      })),
      type: FilterTypes.SELECT,
    },
    [SearchParamsKeys.KEY_PATTERN]: {
      icon: <MdSearch />,
      label: translate("admin:columns.key"),
      type: FilterTypes.TEXT,
    },
    [SearchParamsKeys.LOGICAL_DATE_RANGE]: {
      endKey: SearchParamsKeys.LOGICAL_DATE_LTE,
      icon: <MdDateRange />,
      label: translate("common:logicalDate"),
      startKey: SearchParamsKeys.LOGICAL_DATE_GTE,
      type: FilterTypes.DATERANGE,
    },

Review comment (refactor):
Both branches are identical we could simplify it

```suggestion
        label: translate(option.label),
```

Code after:
      icon: <MdDateRange />,
      label: translate("common:logicalDate"),
      startKey: SearchParamsKeys.AFTER,
      type: FilterTypes.DATERANGE,
    },
    [SearchParamsKeys.EVENT_TYPE]: {
      label: translate("browse:auditLog.filters.eventType"),
      type: FilterTypes.TEXT,
    },
    [SearchParamsKeys.EXECUTOR_CLASS]: {
      hotkeyDisabled: true,
      icon: <MdBuild />,
      label: translate("admin:jobs.columns.executorClass"),
      type: FilterTypes.TEXT,
    },
    [SearchParamsKeys.HOSTNAME]: {
      hotkeyDisabled: true,
      icon: <MdComputer />,
      label: translate("admin:jobs.columns.hostname"),
      type: FilterTypes.TEXT,
    },
    [SearchParamsKeys.JOB_STATE]: {
      icon: <MdCheckCircle />,
      label: translate("common:state"),
      options: jobStateOptions.items.map((option) => ({
        label: translate(option.label),
        value: option.value === "all" ? "" : option.value,
      })),
      type: FilterTypes.SELECT,
    },
    [SearchParamsKeys.JOB_TYPE]: {
      icon: <MdBuild />,
      label: translate("admin:jobs.columns.jobType"),
      options: jobTypeOptions.items.map((option) => ({
        label: translate(option.label),
        value: option.value === "all" ? "" : option.value,
      })),
      type: FilterTypes.SELECT,
    },
    [SearchParamsKeys.KEY_PATTERN]: {
      icon: <MdSearch />,
      label: translate("admin:columns.key"),
      type: FilterTypes.TEXT,
    },
    [SearchParamsKeys.LOGICAL_DATE_RANGE]: {
      endKey: SearchParamsKeys.LOGICAL_DATE_LTE,
      icon: <MdDateRange />,
      label: translate("common:logicalDate"),
      startKey: SearchParamsKeys.LOGICAL_DATE_GTE,
      type: FilterTypes.DATERANGE,
    },