import { ChatSuggestions } from '@agent/components/ChatSuggestions';
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 }) => {
const { answerId, suggestions, 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 = ({ answerId, suggestions }) => {
const hasSuggestions = suggestions?.length > 0;
if (!answerId && !hasSuggestions) return null;
return (
{answerId &&
}
{hasSuggestions && (
{__(
"What's next? Would you like to do something else?",
'extendify-local',
)}
)}
);
};
const WorkflowToolCompleted = ({ label }) => {
return (
{decodeEntities(label) ||
__('Your site was updated', 'extendify-local')}
);
};
const WorkflowToolCanceled = ({ label }) => {
return (
{decodeEntities(label) ||
__('Canceled — nothing was changed', 'extendify-local')}
);
};