рефакторинг

This commit is contained in:
gorbenko.pavel
2026-07-29 17:08:52 +05:00
parent 46552a1381
commit df3558b63a
61 changed files with 1743 additions and 1189 deletions
@@ -1,6 +1,7 @@
import * as React from 'react';
import styles from './SearchableSelect.module.scss';
import { Icon } from './Icon';
import { texts } from '../../texts';
export interface IAsyncSearchResult<T> {
items: T[];
@@ -33,11 +34,11 @@ export function AsyncSearchableSelect<T>({
getValue,
getLabel,
getSublabel,
placeholder = 'Выберите значение',
searchPlaceholder = 'Поиск...',
placeholder = texts.select.placeholder,
searchPlaceholder = texts.select.searchPlaceholder,
disabled,
allowClear,
clearLabel = 'Не выбрано',
clearLabel = texts.select.notSelected,
debounceMs = 350
}: IAsyncSearchableSelectProps<T>): React.ReactElement {
const [open, setOpen] = React.useState(false);
@@ -176,10 +177,10 @@ export function AsyncSearchableSelect<T>({
onChange={e => setQuery(e.target.value)}
/>
<div className={styles.list} ref={listRef}>
{loading && <div className={styles.empty}>Поиск...</div>}
{loading && <div className={styles.empty}>{texts.select.searching}</div>}
{!loading && error && <div className={styles.errorText}>{error}</div>}
{!loading && !error && items.length === 0 && (
<div className={styles.empty}>Ничего не найдено</div>
<div className={styles.empty}>{texts.select.nothingFound}</div>
)}
{!loading && !error && items.map(item => {
const itemValue = getValue(item);