mirror of
https://github.com/zhigang1992/react.git
synced 2026-02-02 09:08:52 +08:00
27 lines
655 B
TypeScript
27 lines
655 B
TypeScript
import React from 'react'
|
|
import withDefaults from '../utils/with-defaults'
|
|
import AutoCompleteSearch from './auto-complete-searching'
|
|
|
|
interface Props {
|
|
hidden?: boolean
|
|
className?: string
|
|
}
|
|
|
|
const defaultProps = {
|
|
hidden: false,
|
|
className: '',
|
|
}
|
|
|
|
export type AutoCompleteEmptyProps = Props & typeof defaultProps & React.HTMLAttributes<any>
|
|
|
|
const AutoCompleteEmpty: React.FC<React.PropsWithChildren<AutoCompleteEmptyProps>> = ({
|
|
children,
|
|
hidden,
|
|
className,
|
|
}) => {
|
|
if (hidden) return null
|
|
return <AutoCompleteSearch className={className}>{children}</AutoCompleteSearch>
|
|
}
|
|
|
|
export default withDefaults(AutoCompleteEmpty, defaultProps)
|