| 1 |
import React from "react"; |
| 2 |
import { __ } from "@wordpress/i18n"; |
| 3 |
import AITableSettings from "../components/AITableSettings"; |
| 4 |
import "../components/AITableSettings.css"; |
| 5 |
|
| 6 |
/* global tablebergAdminMenuData */ |
| 7 |
|
| 8 |
/** |
| 9 |
* Settings content. |
| 10 |
* |
| 11 |
* @class |
| 12 |
*/ |
| 13 |
function SettingsContent() { |
| 14 |
const aiSettings = tablebergAdminMenuData?.ai_settings; |
| 15 |
const isPro = tablebergAdminMenuData?.is_pro; |
| 16 |
|
| 17 |
return ( |
| 18 |
<div className="tableberg-settings-content"> |
| 19 |
{isPro ? ( |
| 20 |
<AITableSettings |
| 21 |
apiKey={aiSettings?.api_key || ""} |
| 22 |
onSettingsChange={newSettings => { |
| 23 |
// Handle settings change if needed |
| 24 |
// Settings updated |
| 25 |
}} |
| 26 |
/> |
| 27 |
) : ( |
| 28 |
<div className="tableberg-pro-notice"> |
| 29 |
<h3>{__("AI Table Settings", "tableberg")}</h3> |
| 30 |
<p> |
| 31 |
{__( |
| 32 |
"AI Table features are available in Tableberg Pro. Upgrade to unlock AI-powered table generation.", |
| 33 |
"tableberg" |
| 34 |
)} |
| 35 |
</p> |
| 36 |
<a |
| 37 |
href="https://tableberg.com/pricing" |
| 38 |
target="_blank" |
| 39 |
rel="noopener noreferrer" |
| 40 |
className="tableberg-button tableberg-button-primary" |
| 41 |
> |
| 42 |
{__("Upgrade to Pro", "tableberg")} |
| 43 |
</a> |
| 44 |
</div> |
| 45 |
)} |
| 46 |
</div> |
| 47 |
); |
| 48 |
} |
| 49 |
|
| 50 |
/** |
| 51 |
* @module SettingsContent |
| 52 |
*/ |
| 53 |
export default SettingsContent; |
| 54 |
|