import { useMemo, useState } from "react"; import { View } from "react-native"; import { useFeedbackBody } from "../../../shared/context/FeedbackBodyProvider.js"; import { useFeedbackUi } from "../../../shared/context/FeedbackProvider.js"; import { allowAuthenticatedAction } from "../../../shared/helpers.js"; import type { FeedbackScreenCommentBranchProps } from "../../../shared/types"; import { Button } from "./Button"; import { Comment, FeedbackForm } from "./primitives.js"; import { useNativeAction } from "../helpers.js"; import type { FeedbackScreenReplyListProps } from "../../../shared/types"; export function ReplyList({ entryId, parentCommentId, }: FeedbackScreenReplyListProps) { const { hooks, commentSort, transformComments } = useFeedbackBody(); const { messages } = useFeedbackUi(); const replies = hooks.useComments({ entryId, parentCommentId, sort: commentSort, }); const visible = useMemo( () => transformComments?.(replies.results) ?? replies.results, [replies.results, transformComments], ); return ( {visible.map((reply) => ( ))} {(replies.status === "CanLoadMore" || replies.status === "LoadingMore") && (