wp-optimize
/
vendor
/
team-updraft
/
lib-onboarding-wizard
/
Wizard
/
Onboarding
/
src
/
components
/
Support.js
Support.js in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 4.5.3, at vendor/team-updraft/lib-onboarding-wizard/Wizard/Onboarding/src/components/Support.js
| 1 | import { __ } from '@wordpress/i18n'; |
| 2 | import useOnboardingStore from "@/store/useOnboardingStore"; |
| 3 | import Hyperlink from "@/utils/Hyperlink.js"; |
| 4 | import ButtonInput from "@/components/Inputs/ButtonInput"; |
| 5 | import {get_website_url} from "@/utils/lib.js"; |
| 6 | |
| 7 | const Support = ({handleManualRetry, isRunning}) => { |
| 8 | const { |
| 9 | onboardingData, |
| 10 | getCurrentStepDocumentation, |
| 11 | getCurrentStepSolutions, |
| 12 | } = useOnboardingStore(); |
| 13 | let documentation = getCurrentStepDocumentation(); |
| 14 | |
| 15 | const articleUrl = get_website_url(documentation, { |
| 16 | utm_source: onboardingData.prefix + '_onboarding', |
| 17 | utm_content: 'documentation' |
| 18 | }); |
| 19 | const supportUrl = get_website_url(onboardingData.support, { |
| 20 | utm_source: onboardingData.prefix + '_onboarding', |
| 21 | utm_content: 'support' |
| 22 | }); |
| 23 | const solutions = getCurrentStepSolutions(); |
| 24 | return ( |
| 25 | <div className="mt-4 max-w-md mx-auto bg-gray-200 border border-gray-300 rounded-lg p-4"> |
| 26 | <ul className="text-sm text-gray-600 space-y-2 list-disc list-inside"> |
| 27 | {solutions.map((text, index) => ( |
| 28 | <li key={index}>{text}</li> |
| 29 | ))} |
| 30 | <li> |
| 31 | <Hyperlink |
| 32 | className={'text-blue-600 hover:text-blue-800 underline'} |
| 33 | url={articleUrl} |
| 34 | target="_blank" |
| 35 | rel="noopener noreferrer" |
| 36 | text={__('For more information, please see our %stroubleshooting article%s.', 'wp-optimize')} |
| 37 | /> |
| 38 | </li> |
| 39 | <li> |
| 40 | {onboardingData.is_pro ? ( |
| 41 | <> |
| 42 | <Hyperlink |
| 43 | className={'text-blue-600 hover:text-blue-800 underline'} |
| 44 | url={articleUrl} |
| 45 | target="_blank" |
| 46 | rel="noopener noreferrer" |
| 47 | text={__('If you are still having issues, please %scontact support%s.', 'wp-optimize')} |
| 48 | /> |
| 49 | </> |
| 50 | ) : ( |
| 51 | <> |
| 52 | <Hyperlink |
| 53 | className={'text-blue-600 hover:text-blue-800 underline'} |
| 54 | url={supportUrl} |
| 55 | target="_blank" |
| 56 | rel="noopener noreferrer" |
| 57 | text={__('If you are still having issues, please %sopen a ticket%s on the WordPress.org support forum.', 'wp-optimize')} |
| 58 | /> |
| 59 | </> |
| 60 | )} |
| 61 | </li> |
| 62 | </ul> |
| 63 | <div className="mt-4 max-w-md mx-auto flex justify-center"> |
| 64 | <ButtonInput |
| 65 | className="w-full" |
| 66 | btnVariant="tertiary" |
| 67 | size="sm" |
| 68 | onClick={() => handleManualRetry()} |
| 69 | disabled={isRunning} |
| 70 | > |
| 71 | {__("Retry test", "wp-optimize")} |
| 72 | </ButtonInput> |
| 73 | </div> |
| 74 | </div> |
| 75 | ); |
| 76 | }; |
| 77 | |
| 78 | export default Support; |