| 1 |
/** |
| 2 |
* Schema Organization Form Component |
| 3 |
* |
| 4 |
* Extracted from SchemaTab.js - handles organization schema form fields |
| 5 |
* |
| 6 |
* @package ThinkRank |
| 7 |
* @since 1.0.0 |
| 8 |
*/ |
| 9 |
|
| 10 |
import { __ } from '@wordpress/i18n'; |
| 11 |
import { |
| 12 |
Card, |
| 13 |
CardBody, |
| 14 |
CardHeader, |
| 15 |
TextControl, |
| 16 |
TextareaControl, |
| 17 |
SelectControl |
| 18 |
} from '@wordpress/components'; |
| 19 |
|
| 20 |
// Import shared components |
| 21 |
import MediaPicker from '../../../common/MediaPicker'; |
| 22 |
|
| 23 |
// Import shared schema configuration |
| 24 |
import { |
| 25 |
getOrganizationTypeOptions, |
| 26 |
getContactTypeOptions |
| 27 |
} from '../../../../config/schema-settings-config'; |
| 28 |
|
| 29 |
/** |
| 30 |
* Schema Organization Form Component |
| 31 |
*/ |
| 32 |
const SchemaOrganizationForm = ({ |
| 33 |
settings, |
| 34 |
onSettingChange, |
| 35 |
isLoading |
| 36 |
}) => { |
| 37 |
return ( |
| 38 |
<div className="tab-content"> |
| 39 |
<Card size="small"> |
| 40 |
<CardHeader> |
| 41 |
<h3>{__('Organization Schema', 'thinkrank')}</h3> |
| 42 |
</CardHeader> |
| 43 |
<CardBody> |
| 44 |
<SelectControl |
| 45 |
label={__('Organization Type', 'thinkrank')} |
| 46 |
value={settings.organization_type} |
| 47 |
options={getOrganizationTypeOptions()} |
| 48 |
onChange={(value) => onSettingChange('organization_type', value)} |
| 49 |
help={__('Type of organization for schema markup', 'thinkrank')} |
| 50 |
__next40pxDefaultSize={true} |
| 51 |
__nextHasNoMarginBottom={true} |
| 52 |
className="thinkrank-mb-sm" |
| 53 |
/> |
| 54 |
|
| 55 |
<TextControl |
| 56 |
label={__('Organization Name', 'thinkrank')} |
| 57 |
value={settings.organization_name} |
| 58 |
onChange={(value) => onSettingChange('organization_name', value)} |
| 59 |
help={__('Official name of your organization', 'thinkrank')} |
| 60 |
disabled={!settings.enabled} |
| 61 |
__next40pxDefaultSize={true} |
| 62 |
__nextHasNoMarginBottom={true} |
| 63 |
className="thinkrank-mb-sm" |
| 64 |
/> |
| 65 |
|
| 66 |
<TextControl |
| 67 |
label={__('Organization URL', 'thinkrank')} |
| 68 |
value={settings.organization_url} |
| 69 |
onChange={(value) => onSettingChange('organization_url', value)} |
| 70 |
help={__('Official website URL of your organization', 'thinkrank')} |
| 71 |
disabled={!settings.enabled} |
| 72 |
__next40pxDefaultSize={true} |
| 73 |
__nextHasNoMarginBottom={true} |
| 74 |
className="thinkrank-mb-sm" |
| 75 |
/> |
| 76 |
|
| 77 |
<TextareaControl |
| 78 |
label={__('Organization Description', 'thinkrank')} |
| 79 |
value={settings.organization_description} |
| 80 |
onChange={(value) => onSettingChange('organization_description', value)} |
| 81 |
help={__('Brief description of your organization', 'thinkrank')} |
| 82 |
disabled={!settings.enabled} |
| 83 |
rows={3} |
| 84 |
__nextHasNoMarginBottom={true} |
| 85 |
className="thinkrank-mb-sm" |
| 86 |
/> |
| 87 |
|
| 88 |
<MediaPicker |
| 89 |
label={__('Organization Logo', 'thinkrank')} |
| 90 |
value={settings.organization_logo} |
| 91 |
onChange={(value) => onSettingChange('organization_logo', value)} |
| 92 |
help={__('Logo image for your organization', 'thinkrank')} |
| 93 |
disabled={!settings.enabled} |
| 94 |
className="thinkrank-mb-sm" |
| 95 |
/> |
| 96 |
|
| 97 |
<div style={{ |
| 98 |
padding: '12px', |
| 99 |
backgroundColor: '#f0f6ff', |
| 100 |
border: '1px solid #0073aa', |
| 101 |
borderRadius: '4px', |
| 102 |
marginBottom: '16px' |
| 103 |
}}> |
| 104 |
<h5 style={{ margin: '0 0 8px 0', fontSize: '13px', color: '#0073aa' }}> |
| 105 |
{__('Business Address & Contact Info', 'thinkrank')} |
| 106 |
</h5> |
| 107 |
<p style={{ margin: 0, fontSize: '12px', color: '#666' }}> |
| 108 |
{__('Business address, phone, and email are now managed in Site Identity > Business Info tab. This ensures consistency across all local SEO features and schema markup.', 'thinkrank')} |
| 109 |
</p> |
| 110 |
</div> |
| 111 |
|
| 112 |
<h4 className="thinkrank-mb-sm thinkrank-mt-md">{__('Social Media Links', 'thinkrank')}</h4> |
| 113 |
|
| 114 |
<TextControl |
| 115 |
label={__('Facebook URL', 'thinkrank')} |
| 116 |
value={settings.organization_social_facebook} |
| 117 |
onChange={(value) => onSettingChange('organization_social_facebook', value)} |
| 118 |
help={__('Facebook page URL', 'thinkrank')} |
| 119 |
disabled={!settings.enabled} |
| 120 |
__next40pxDefaultSize={true} |
| 121 |
__nextHasNoMarginBottom={true} |
| 122 |
className="thinkrank-mb-sm" |
| 123 |
/> |
| 124 |
|
| 125 |
<TextControl |
| 126 |
label={__('Twitter URL', 'thinkrank')} |
| 127 |
value={settings.organization_social_twitter} |
| 128 |
onChange={(value) => onSettingChange('organization_social_twitter', value)} |
| 129 |
help={__('Twitter profile URL', 'thinkrank')} |
| 130 |
disabled={!settings.enabled} |
| 131 |
__next40pxDefaultSize={true} |
| 132 |
__nextHasNoMarginBottom={true} |
| 133 |
className="thinkrank-mb-sm" |
| 134 |
/> |
| 135 |
|
| 136 |
<TextControl |
| 137 |
label={__('LinkedIn URL', 'thinkrank')} |
| 138 |
value={settings.organization_social_linkedin} |
| 139 |
onChange={(value) => onSettingChange('organization_social_linkedin', value)} |
| 140 |
help={__('LinkedIn company page URL', 'thinkrank')} |
| 141 |
disabled={!settings.enabled} |
| 142 |
__next40pxDefaultSize={true} |
| 143 |
__nextHasNoMarginBottom={true} |
| 144 |
className="thinkrank-mb-sm" |
| 145 |
/> |
| 146 |
|
| 147 |
<TextControl |
| 148 |
label={__('Instagram URL', 'thinkrank')} |
| 149 |
value={settings.organization_social_instagram} |
| 150 |
onChange={(value) => onSettingChange('organization_social_instagram', value)} |
| 151 |
help={__('Instagram profile URL', 'thinkrank')} |
| 152 |
disabled={!settings.enabled} |
| 153 |
__next40pxDefaultSize={true} |
| 154 |
__nextHasNoMarginBottom={true} |
| 155 |
className="thinkrank-mb-sm" |
| 156 |
/> |
| 157 |
|
| 158 |
<TextControl |
| 159 |
label={__('YouTube URL', 'thinkrank')} |
| 160 |
value={settings.organization_social_youtube} |
| 161 |
onChange={(value) => onSettingChange('organization_social_youtube', value)} |
| 162 |
help={__('YouTube channel URL', 'thinkrank')} |
| 163 |
disabled={!settings.enabled} |
| 164 |
__next40pxDefaultSize={true} |
| 165 |
__nextHasNoMarginBottom={true} |
| 166 |
className="thinkrank-mb-sm" |
| 167 |
/> |
| 168 |
|
| 169 |
<h4 className="thinkrank-mb-sm thinkrank-mt-md">{__('Contact Information', 'thinkrank')}</h4> |
| 170 |
|
| 171 |
<SelectControl |
| 172 |
label={__('Contact Type', 'thinkrank')} |
| 173 |
value={settings.organization_contact_type} |
| 174 |
options={getContactTypeOptions()} |
| 175 |
onChange={(value) => onSettingChange('organization_contact_type', value)} |
| 176 |
help={__('Type of contact point', 'thinkrank')} |
| 177 |
disabled={!settings.enabled} |
| 178 |
__next40pxDefaultSize={true} |
| 179 |
__nextHasNoMarginBottom={true} |
| 180 |
className="thinkrank-mb-sm" |
| 181 |
/> |
| 182 |
|
| 183 |
<TextControl |
| 184 |
label={__('Contact Phone', 'thinkrank')} |
| 185 |
value={settings.organization_contact_phone} |
| 186 |
onChange={(value) => onSettingChange('organization_contact_phone', value)} |
| 187 |
help={__('Contact phone number', 'thinkrank')} |
| 188 |
disabled={!settings.enabled} |
| 189 |
__next40pxDefaultSize={true} |
| 190 |
__nextHasNoMarginBottom={true} |
| 191 |
className="thinkrank-mb-sm" |
| 192 |
/> |
| 193 |
|
| 194 |
<TextControl |
| 195 |
label={__('Contact Email', 'thinkrank')} |
| 196 |
value={settings.organization_contact_email} |
| 197 |
onChange={(value) => onSettingChange('organization_contact_email', value)} |
| 198 |
help={__('Contact email address', 'thinkrank')} |
| 199 |
disabled={!settings.enabled} |
| 200 |
__next40pxDefaultSize={true} |
| 201 |
__nextHasNoMarginBottom={true} |
| 202 |
className="thinkrank-mb-sm" |
| 203 |
/> |
| 204 |
|
| 205 |
<div style={{ |
| 206 |
padding: '12px', |
| 207 |
backgroundColor: '#f8f9fa', |
| 208 |
border: '1px solid #dee2e6', |
| 209 |
borderRadius: '4px' |
| 210 |
}}> |
| 211 |
<h5 style={{ margin: '0 0 8px 0', fontSize: '13px' }}>{__('Current Contact Hours:', 'thinkrank')}</h5> |
| 212 |
<p style={{ margin: 0, fontSize: '12px', color: '#666' }}> |
| 213 |
{settings.organization_contact_hours |
| 214 |
? settings.organization_contact_hours |
| 215 |
: __('No contact hours configured. Sync from Local SEO to populate.', 'thinkrank') |
| 216 |
} |
| 217 |
</p> |
| 218 |
<p className="components-base-control__help" style={{ marginTop: '8px', fontSize: '12px', color: '#757575' }}> |
| 219 |
{__('Contact hours are automatically synced from Local SEO business hours. Configure business hours in the Local SEO tab.', 'thinkrank')} |
| 220 |
</p> |
| 221 |
</div> |
| 222 |
|
| 223 |
|
| 224 |
|
| 225 |
</CardBody> |
| 226 |
</Card> |
| 227 |
</div> |
| 228 |
); |
| 229 |
}; |
| 230 |
|
| 231 |
export default SchemaOrganizationForm; |
| 232 |
|