From 14f516d5cc64b38a8ac9185702ad0b74a3fc2059 Mon Sep 17 00:00:00 2001 From: Denozordec Date: Tue, 21 Jul 2026 01:06:59 +0700 Subject: [PATCH] feat(web): refactor list selection components for improved maintainability - Introduced constants for selection items in both list detail and lists pages to enhance code readability and maintainability. - Updated the Select components to utilize the new constants, streamlining the rendering of options for 'add mode' and 'create source'. - Improved user experience by ensuring consistent labeling and structure across selection interfaces. --- apps/web/src/routes/_auth/lists/$id.tsx | 23 +++++++++++++++++------ apps/web/src/routes/_auth/lists/index.tsx | 19 +++++++++++++------ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/apps/web/src/routes/_auth/lists/$id.tsx b/apps/web/src/routes/_auth/lists/$id.tsx index 8cc0ec9..575da59 100644 --- a/apps/web/src/routes/_auth/lists/$id.tsx +++ b/apps/web/src/routes/_auth/lists/$id.tsx @@ -77,6 +77,11 @@ type ListItem = { resolved_cidrs: string[] } +const ADD_MODE_ITEMS = [ + { value: 'plaintext', label: 'Значения (автоопределение)' }, + { value: 'nested', label: 'Вложенный список' }, +] as const + /** * List detail — DetailPanel + KpiStatGrid + entries ResourcePage. * KPI: https://reui.io/preview/base/stats-12 @@ -513,19 +518,21 @@ function ListDetailPage() { Режим @@ -533,12 +540,16 @@ function ListDetailPage() { Список { if (v) setSource(v as CreateSource) }} > - + - Ручной - JSON по URL - - EvoBGP community - + {CREATE_SOURCE_ITEMS.map((item) => ( + + {item.label} + + ))}