Skip to content

Commit

Permalink
fix: add loadingText
Browse files Browse the repository at this point in the history
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier@rte-france.com>
  • Loading branch information
LE SAULNIER Kevin committed May 15, 2024
1 parent dbc9052 commit 016b8d5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/ElementSearchDialog/element-search-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ interface ElementSearchDialogProps {
searchTerm: string;
onSearchTermChange: (searchTerm: string) => void;
onSelectionChange: (selection: EquipmentInfos) => void;
elementsFound: EquipmentInfos[]; // [{ label: aLabel, id: anId }, ...]
elementsFound: EquipmentInfos[];
renderElement: (props: any) => ReactNode;
searchTermDisabled?: boolean;
searchTermDisableReason?: string;
isLoading: boolean;
isLoadingText: string;
}

const ElementSearchDialog = (props: ElementSearchDialogProps) => {
Expand All @@ -43,11 +44,12 @@ const ElementSearchDialog = (props: ElementSearchDialogProps) => {
searchTerm,
onSearchTermChange,
onSelectionChange,
elementsFound, // [{ label: aLabel, id: anId }, ...]
elementsFound,
renderElement,
searchTermDisabled,
searchTermDisableReason,
isLoading,
isLoadingText,
} = props;

const displayedValue = useMemo(() => {
Expand Down Expand Up @@ -118,6 +120,7 @@ const ElementSearchDialog = (props: ElementSearchDialogProps) => {
}}
options={isLoading ? [] : elementsFound}
loading={isLoading}
loadingText={isLoadingText}
autoHighlight={true}
noOptionsText={intl.formatMessage({
id: 'element_search/noResult',
Expand Down

0 comments on commit 016b8d5

Please sign in to comment.