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:
Michele
2026-04-07 11:03:34 +02:00
parent 2b9129591c
commit 9a8b3c4e14

View File

@@ -2,6 +2,9 @@ import React, { useState, useEffect, useRef } from 'react'
import { useNavigate, useSearchParams } from 'react-router-dom' import { useNavigate, useSearchParams } from 'react-router-dom'
import { api } from '../api' import { api } from '../api'
import { useAuth } from '../AuthContext' import { useAuth } from '../AuthContext'
import SocialAccounts from './SocialAccounts'
import AffiliateList from './AffiliateList'
import CommentsQueue from './CommentsQueue'
// ─── Provider catalogs ──────────────────────────────────────────────────────── // ─── Provider catalogs ────────────────────────────────────────────────────────
const TEXT_PROVIDERS = [ const TEXT_PROVIDERS = [
@@ -152,6 +155,9 @@ const SECTIONS = [
{ id: 'profilo', label: 'Profilo' }, { id: 'profilo', label: 'Profilo' },
{ id: 'piano', label: 'Piano & Account' }, { id: 'piano', label: 'Piano & Account' },
{ id: 'ai', label: 'Provider AI' }, { id: 'ai', label: 'Provider AI' },
{ id: 'social', label: 'Account Social' },
{ id: 'affiliati', label: 'Link Affiliati' },
{ id: 'commenti', label: 'Commenti' },
{ id: 'sicurezza', label: 'Sicurezza' }, { id: 'sicurezza', label: 'Sicurezza' },
{ id: 'privacy', label: 'Privacy & Dati' }, { id: 'privacy', label: 'Privacy & Dati' },
] ]
@@ -256,6 +262,9 @@ export default function SettingsPage() {
<AISection values={aiValues} onChange={(k, v) => setAiValues(p => ({ ...p, [k]: v }))} <AISection values={aiValues} onChange={(k, v) => setAiValues(p => ({ ...p, [k]: v }))}
saveAI={saveAI} loading={loadingAI} saving={saving} success={success} errors={errors} /> saveAI={saveAI} loading={loadingAI} saving={saving} success={success} errors={errors} />
)} )}
{activeSection === 'social' && <SocialAccounts />}
{activeSection === 'affiliati' && <AffiliateList />}
{activeSection === 'commenti' && <CommentsQueue />}
{activeSection === 'sicurezza' && ( {activeSection === 'sicurezza' && (
<SicurezzaSection user={user} saving={saving} success={success} errors={errors} setMsg={setMsg} setSaving={setSaving} /> <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 = { const inputStyle = {
width: '100%', padding: '0.625rem 0.875rem', width: '100%', padding: '0.625rem 0.875rem',
border: '1px solid var(--border)', borderRadius: 0, border: '1px solid var(--border)', borderRadius: 0,