import { __ } from '@wordpress/i18n';
import React, { useState } from 'react';
import Header from '../components/layout/Header';
import PluginPage from '../components/layout/PluginPage';
import Card from '../components/ui/card';
import ProAlert from '../components/ui/pro-alert';
/**
* Free upsell page for CDN offloading.
*
* Pro replaces this component through `thumbpress_component_map` once the
* license is active, and registers its own `/cdn` route + nav item from PHP.
* The free plugin only ships this route while pro is missing or unlicensed.
*/
export default function CDN() {
const [alertOpen, setAlertOpen] = useState(false);
const openAlert = () => setAlertOpen(true);
const detectImageUrl =
(window.THUMBPRESS?.assets_url || '') + 'admin/img/no-search-result.png';
const features = [
{
title: __( 'Auto-offload new uploads', 'image-sizes' ),
description: __( 'Every new image is pushed to the CDN the moment it lands in your media library.', 'image-sizes' ),
},
{
title: __( 'Free up server disk space', 'image-sizes' ),
description: __( 'Keep a local copy or drop it after upload and serve everything from the edge.', 'image-sizes' ),
},
{
title: __( 'Responsive images included', 'image-sizes' ),
description: __( 'srcset URLs and WooCommerce product, variation and gallery images are rewritten too.', 'image-sizes' ),
},
{
title: __( 'Automatic local fallback', 'image-sizes' ),
description: __( 'If the CDN is ever unreachable, images are served from your server instead of breaking the page.', 'image-sizes' ),
},
];
return (
<>
{/* Empty state */}
{__( 'Ready to Move Your Images to the Edge?', 'image-sizes' )}
{__( 'Connect ThumbPress CDN and every image in your library is delivered from the location nearest your visitor.', 'image-sizes' )}