{
// Prevent input blur event
e.preventDefault()
}}
- // show={!!searchData}
>
{message}
{albumElements.length > 0 && (
-
- {t('header.search.result_type.albums', 'Albums')}
-
+ <>
+
+ {t('header.search.result_type.albums', 'Albums')}
+
+
+ >
)}
- {albumElements}
{mediaElements.length > 0 && (
-
- {t('header.search.result_type.media', 'Media')}
-
+ <>
+
+ {t('header.search.result_type.media', 'Media')}
+
+
+ >
)}
- {mediaElements}
)
}
-const RowLink = styled(NavLink).attrs({
- className:
- 'focus:bg-gray-100 hover:bg-gray-100 focus:ring-1 outline-none rounded p-1 mt-1 flex items-center',
-})``
+type SearchRowProps = {
+ id: string
+ link: string
+ preview: React.ReactNode
+ label: React.ReactNode
+ selected: boolean
+ setSelected(): void
+}
-const RowTitle = styled.span.attrs({ className: 'flex-grow pl-2' })``
+const SearchRow = ({
+ id,
+ link,
+ preview,
+ label,
+ selected,
+ setSelected,
+}: SearchRowProps) => {
+ const rowEl = useRef