feat: integrate Social, Affiliati, Commenti into Settings page
- Add Social, Link Affiliati, Commenti as tabs in Settings page - Import and render existing components directly (they have their own headers) - Sections accessible via /settings?tab=social, ?tab=affiliati, ?tab=commenti Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,9 @@ import React, { useState, useEffect, useRef } from 'react'
|
||||
import { useNavigate, useSearchParams } from 'react-router-dom'
|
||||
import { api } from '../api'
|
||||
import { useAuth } from '../AuthContext'
|
||||
import SocialAccounts from './SocialAccounts'
|
||||
import AffiliateList from './AffiliateList'
|
||||
import CommentsQueue from './CommentsQueue'
|
||||
|
||||
// ─── Provider catalogs ────────────────────────────────────────────────────────
|
||||
const TEXT_PROVIDERS = [
|
||||
@@ -149,11 +152,14 @@ const PROVIDER_GUIDES = {
|
||||
}
|
||||
|
||||
const SECTIONS = [
|
||||
{ id: 'profilo', label: 'Profilo' },
|
||||
{ id: 'piano', label: 'Piano & Account' },
|
||||
{ id: 'ai', label: 'Provider AI' },
|
||||
{ id: 'sicurezza',label: 'Sicurezza' },
|
||||
{ id: 'privacy', label: 'Privacy & Dati' },
|
||||
{ id: 'profilo', label: 'Profilo' },
|
||||
{ id: 'piano', label: 'Piano & Account' },
|
||||
{ id: 'ai', label: 'Provider AI' },
|
||||
{ id: 'social', label: 'Account Social' },
|
||||
{ id: 'affiliati', label: 'Link Affiliati' },
|
||||
{ id: 'commenti', label: 'Commenti' },
|
||||
{ id: 'sicurezza', label: 'Sicurezza' },
|
||||
{ id: 'privacy', label: 'Privacy & Dati' },
|
||||
]
|
||||
|
||||
export default function SettingsPage() {
|
||||
@@ -256,6 +262,9 @@ export default function SettingsPage() {
|
||||
<AISection values={aiValues} onChange={(k, v) => setAiValues(p => ({ ...p, [k]: v }))}
|
||||
saveAI={saveAI} loading={loadingAI} saving={saving} success={success} errors={errors} />
|
||||
)}
|
||||
{activeSection === 'social' && <SocialAccounts />}
|
||||
{activeSection === 'affiliati' && <AffiliateList />}
|
||||
{activeSection === 'commenti' && <CommentsQueue />}
|
||||
{activeSection === 'sicurezza' && (
|
||||
<SicurezzaSection user={user} saving={saving} success={success} errors={errors} setMsg={setMsg} setSaving={setSaving} />
|
||||
)}
|
||||
@@ -844,6 +853,21 @@ function Spinner() {
|
||||
)
|
||||
}
|
||||
|
||||
function EmbeddedSection({ title, description, children }) {
|
||||
return (
|
||||
<div>
|
||||
<h3 style={{ fontFamily: "'Fraunces', serif", fontSize: '1.35rem', fontWeight: 600, color: 'var(--ink)', margin: '0 0 0.3rem' }}>{title}</h3>
|
||||
<div className="editorial-line" />
|
||||
<p style={{ fontSize: '0.85rem', color: 'var(--ink-muted)', margin: '0.5rem 0 1.5rem' }}>{description}</p>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function SocialAccountsEmbed() { return <SocialAccounts /> }
|
||||
function AffiliateListEmbed() { return <AffiliateList /> }
|
||||
function CommentsQueueEmbed() { return <CommentsQueue /> }
|
||||
|
||||
const inputStyle = {
|
||||
width: '100%', padding: '0.625rem 0.875rem',
|
||||
border: '1px solid var(--border)', borderRadius: 0,
|
||||
|
||||
Reference in New Issue
Block a user