pl-fe: improve nested quoted status indication

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2025-11-01 13:10:39 +01:00
parent 5128e83df5
commit 0fb8c694c6
3 changed files with 10 additions and 6 deletions

View File

@ -8,20 +8,22 @@ import { makeGetStatus } from 'pl-fe/selectors';
interface IQuotedStatusIndicator {
/** The quoted status id. */
statusId: string;
statusId?: string;
/** The quoted status URL. */
statusUrl?: string;
}
const QuotedStatusIndicator: React.FC<IQuotedStatusIndicator> = ({ statusId }) => {
const QuotedStatusIndicator: React.FC<IQuotedStatusIndicator> = ({ statusId, statusUrl }) => {
const getStatus = useCallback(makeGetStatus(), []);
const status = useAppSelector(state => getStatus(state, { id: statusId }));
statusUrl = useAppSelector(state => statusUrl || statusId && getStatus(state, { id: statusId })?.url);
if (!status) return null;
if (!statusUrl) return null;
return (
<HStack alignItems='center' space={1}>
<Icon className='size-5' src={require('@phosphor-icons/core/regular/quotes.svg')} aria-hidden />
<Text truncate>{status.url}</Text>
<Text truncate>{statusUrl}</Text>
</HStack>
);
};

View File

@ -103,7 +103,7 @@ const QuotedStatus: React.FC<IQuotedStatus> = ({ status, onCancel, compose }) =>
isQuote
/>
{status.quote_id && <QuotedStatusIndicator statusId={status.quote_id} />}
{status.quote_id && <QuotedStatusIndicator statusId={status.quote_id} statusUrl={status.quote_url} />}
{status.media_attachments.length > 0 && (
<div className='relative'>