import { useQuery } from '@apollo/client' import { ItemSkeleton } from './item' import styles from './items.module.css' import { ITEM_SEARCH } from '../fragments/items' import MoreFooter from './more-footer' import { Fragment } from 'react' import { CommentFlat } from './comment' import ItemFull from './item-full' export default function SearchItems ({ variables, items, pins, cursor }) { const { data, fetchMore } = useQuery(ITEM_SEARCH, { variables }) if (!data && !items) { return } if (data) { ({ search: { items, cursor } } = data) } return ( <>
{items.map((item, i) => ( {item.parentId ? <>
: <>
} ))}
} /> ) } function ItemsSkeleton () { const items = new Array(21).fill(null) return (
{items.map((_, i) => ( ))}
) }