import { FollowUpCard } from '@agent/components/FollowUpCard';
import { Rating } from '@agent/components/Rating';
import { decodeEntities } from '@wordpress/html-entities';
import { __ } from '@wordpress/i18n';
// Note: this used to have more status like joined, cancelled, transferred etc.
export const WorkflowMessage = ({ message, latest }) => {
const { status, label } = message.details;
if (status === 'canceled') {
return (
<>
>
);
}
return (
<>
{/* No label on a static-component finish — its own message shows the result. */}
{label && }
>
);
};
const WorkflowFooter = ({ message, latest }) => {
const { answerId, followUp, followUpClosed } = message.details;
const showCard = latest && followUp && !followUpClosed;
if (!answerId && !showCard) return null;
return (
{answerId && }
{showCard && }
);
};
const WorkflowToolCompleted = ({ label }) => {
return (
{decodeEntities(label) ||
__('Your site was updated', 'extendify-local')}
);
};
const WorkflowToolCanceled = ({ label }) => {
return (
{decodeEntities(label) ||
__('Canceled — nothing was changed', 'extendify-local')}
);
};