({
post,
origin,
}: UseReadArticle)
| 37 | } |
| 38 | |
| 39 | export const useReadArticle = ({ |
| 40 | post, |
| 41 | origin, |
| 42 | }: UseReadArticle): EmptyPromise => { |
| 43 | const onPostClick = useOnPostClick({ origin }); |
| 44 | |
| 45 | return useCallback(() => { |
| 46 | const { target, parentId } = getPostReadTarget(post); |
| 47 | |
| 48 | return onPostClick({ |
| 49 | post: target || post, |
| 50 | optional: { parent_id: parentId }, |
| 51 | }); |
| 52 | }, [onPostClick, post]); |
| 53 | }; |
| 54 | |
| 55 | const usePostContent = ({ |
| 56 | origin, |
no test coverage detected