UNPKG

@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.

25 lines 1.15 kB
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.js'; 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, boxSizing: 'border-box', }, children: _jsx(SearchInput, { inputRef: inputRef, onChange: onChange, placeholder: t('main.searchNetwork'), size: "small", onClear: handleClear }) })); } return (_jsx(StickySearchInput, { inputRef: inputRef, onChange: onChange, placeholder: t('main.searchNetwork'), onClear: handleClear })); }; //# sourceMappingURL=ChainSearchInput.js.map