{"version":3,"file":"Posts-DrCPmuKn.js","sources":["../../../frontend/src/Components/PostList/Posts.tsx"],"sourcesContent":["import React from 'react';\n\nimport usePostsInfiniteQuery from '../../Hooks/usePostsInfiniteQuery';\nimport { PostVisibilities } from '../../Utils/Types';\nimport ListItems from './ListItems';\nimport useSpace from '../../Hooks/useSpace';\n\nfunction Posts({ postsTypes, limit, queryOptions = {}, emptyState, post, ...rest }: any) {\n const { space } = useSpace();\n const { pages, postsCount, paging, isFetching, hasNextPage, fetchNextPage } =\n usePostsInfiniteQuery([postsTypes.join('-'), post?.id], {\n space,\n post,\n types: postsTypes,\n visibilities: [PostVisibilities.PUBLISHED],\n limit,\n sort: '-dates',\n ...queryOptions,\n });\n\n const showSkeleton = isFetching && !postsCount;\n const showEmptyState = postsCount === 0 && !showSkeleton;\n\n if (showEmptyState) {\n return emptyState || null;\n }\n\n return (\n \n );\n}\n\nexport default Posts;\n"],"names":["Posts","_ref","postsTypes","limit","_ref$queryOptions","queryOptions","emptyState","post","rest","_objectWithoutProperties","_excluded","_useSpace","useSpace","space","_usePostsInfiniteQuer","usePostsInfiniteQuery","join","id","_objectSpread","types","visibilities","PostVisibilities","PUBLISHED","sort","pages","postsCount","paging","isFetching","hasNextPage","fetchNextPage","showSkeleton","showEmptyState","React","createElement","ListItems","_extends"],"mappings":"6iEAOA,SAASA,EAAKC,EAA2E,CAAxEC,IAAAA,EAAUD,EAAVC,WAAYC,EAAKF,EAALE,MAAKC,EAAAH,EAAEI,aAAAA,EAAYD,IAAA,OAAG,CAAEA,EAAAA,EAAEE,EAAUL,EAAVK,WAAYC,EAAIN,EAAJM,KAASC,EAAIC,EAAAR,EAAAS,CAAA,EAC9EC,EAAkBC,EAAAA,EAAVC,EAAKF,EAALE,MACRC,EACEC,EAAsB,CAACb,EAAWc,KAAK,GAAG,EAAGT,QAAI,OAAJA,EAAMU,EAAE,EAACC,EAAA,CACpDL,MAAAA,EACAN,KAAAA,EACAY,MAAOjB,EACPkB,aAAc,CAACC,EAAiBC,SAAS,EACzCnB,MAAAA,EACAoB,KAAM,QAAA,EACHlB,CAAY,CAChB,EATKmB,EAAKV,EAALU,MAAOC,EAAUX,EAAVW,WAAYC,EAAMZ,EAANY,OAAQC,EAAUb,EAAVa,WAAYC,EAAWd,EAAXc,YAAaC,EAAaf,EAAbe,cAWtDC,EAAeH,GAAc,CAACF,EAC9BM,EAAiBN,IAAe,GAAK,CAACK,EAE5C,OAAIC,EACKzB,GAAc,KAIrB0B,EAAAC,cAACC,EAASC,EAAA,CACRN,cAAAA,EACAD,YAAAA,EACAF,OAAAA,EACAF,MAAAA,EACAO,eAAAA,EACAD,aAAAA,EACAjB,MAAAA,EACAY,WAAAA,CAAuB,EACnBjB,CAAI,CACT,CAEL"}