/
githubmirror
/
wp-calypso
Обзор
Документация
Войти
/
githubmirror
/
wp-calypso
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
client/reader/stream/error.tsx
35 строк
969 B
Mehmood Ahmad
Reader: Fix posts duplication, clearing of feed and multiple identical requests on Search page (#113484)
11 авг 2026, 22:52
Не верифицирован
11 авг 2026, 22:52
ff59d9f
Код
Авторство
О чём код?
import { recordTracksEvent } from '@automattic/calypso-analytics'; import { useTranslate } from 'i18n-calypso'; import EmptyContent from 'calypso/components/empty-content'; /** * Props for the StreamError component. * @param onTryAgain - Callback to try again. * @param streamKey - The key of the stream. */ interface StreamErrorProps { onTryAgain?: () => void; streamKey: string; } export const StreamError = ( { onTryAgain, streamKey }: StreamErrorProps ) => { const translate = useTranslate(); const handleTryAgain = () => { recordTracksEvent( 'calypso_reader_stream_error_try_again', { stream_key: streamKey, path: window.location.pathname, } ); onTryAgain?.(); }; return ( <EmptyContent className="stream__empty" title={ translate( 'Sorry, something went wrong.' ) } line={ translate( 'We couldn’t load your feed. Please try again.' ) } action={ translate( 'Try again' ) } actionCallback={ handleTryAgain } /> ); };