@lifi/widget
Version:
LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.
19 lines • 1.02 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { Box } from '@mui/material';
import { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { SearchInput, StickySearchInput } from '../Search/SearchInput';
export const ChainSearchInput = ({ inputRef, inExpansion, onChange, onClear, searchHeaderHeight, }) => {
const { t } = useTranslation();
const handleClear = useCallback(() => {
if (inputRef.current) {
inputRef.current.value = '';
}
onClear();
}, [onClear, inputRef.current]);
if (inExpansion) {
return (_jsx(Box, { sx: { pt: 3, pb: 2, px: 2.5, height: searchHeaderHeight }, children: _jsx(SearchInput, { inputRef: inputRef, onChange: onChange, placeholder: t('main.searchChain'), size: "small", onClear: handleClear }) }));
}
return (_jsx(StickySearchInput, { inputRef: inputRef, onChange: onChange, placeholder: t('main.searchChain'), onClear: handleClear }));
};
//# sourceMappingURL=ChainSearchInput.js.map