|
@@ -2,7 +2,7 @@ import styled from '@emotion/styled'
|
|
|
import React, { useState, useMemo } from 'react'
|
|
|
|
|
|
import { useSearch } from '@/api/hooks'
|
|
|
-import { SearchQuery } from '@/api/queries'
|
|
|
+import { SearchQuery, AssetAvailability } from '@/api/queries'
|
|
|
import { VideoGrid, PlaceholderVideoGrid, ChannelGrid, ViewWrapper } from '@/components'
|
|
|
import { usePersonalData } from '@/hooks'
|
|
|
import { Tabs } from '@/shared/components'
|
|
@@ -18,7 +18,14 @@ const tabs = ['all results', 'videos', 'channels']
|
|
|
|
|
|
const SearchResults: React.FC<SearchResultsProps> = ({ query }) => {
|
|
|
const [selectedIndex, setSelectedIndex] = useState(0)
|
|
|
- const { data, loading, error } = useSearch({ text: query })
|
|
|
+ const { data, loading, error } = useSearch({
|
|
|
+ text: query,
|
|
|
+ whereVideo: {
|
|
|
+ mediaAvailability_eq: AssetAvailability.Accepted,
|
|
|
+ thumbnailPhotoAvailability_eq: AssetAvailability.Accepted,
|
|
|
+ },
|
|
|
+ whereChannel: {},
|
|
|
+ })
|
|
|
|
|
|
const getChannelsAndVideos = (loading: boolean, data: SearchQuery['search'] | undefined) => {
|
|
|
if (loading || !data) {
|