Always version 0.5.4
This commit is contained in:
1 parent
3670d0b5a0
commit
c5b54786f8
23 files changed
+2176
-1496
No files matched your search
@@ -1021,27 +1021,30 @@ class EnhancedStrategyService:
|
||||
}
|
||||
|
||||
# Audience Intelligence Fields
|
||||
audience_data = research_data.get('audience_intelligence', {})
|
||||
# Extract audience data from research_data structure
|
||||
audience_research = research_data.get('audience_research', {})
|
||||
content_prefs = research_data.get('content_preferences', {})
|
||||
|
||||
fields['content_preferences'] = {
|
||||
'value': research_data.get('content_preferences', {}),
|
||||
'value': content_prefs,
|
||||
'source': 'research_preferences',
|
||||
'confidence': research_data.get('confidence_level', 0.8)
|
||||
}
|
||||
|
||||
fields['consumption_patterns'] = {
|
||||
'value': audience_data.get('consumption_patterns', {}),
|
||||
'value': audience_research.get('consumption_patterns', {}),
|
||||
'source': 'research_preferences',
|
||||
'confidence': research_data.get('confidence_level', 0.8)
|
||||
}
|
||||
|
||||
fields['audience_pain_points'] = {
|
||||
'value': audience_data.get('pain_points', []),
|
||||
'value': audience_research.get('audience_pain_points', []),
|
||||
'source': 'research_preferences',
|
||||
'confidence': research_data.get('confidence_level', 0.8)
|
||||
}
|
||||
|
||||
fields['buying_journey'] = {
|
||||
'value': audience_data.get('buying_journey', {}),
|
||||
'value': audience_research.get('buying_journey', {}),
|
||||
'source': 'research_preferences',
|
||||
'confidence': research_data.get('confidence_level', 0.8)
|
||||
}
|
||||
@@ -1064,7 +1067,11 @@ class EnhancedStrategyService:
|
||||
|
||||
# Competitive Intelligence Fields
|
||||
fields['top_competitors'] = {
|
||||
'value': website_data.get('competitors', []),
|
||||
'value': website_data.get('competitors', [
|
||||
'Competitor A - Industry Leader',
|
||||
'Competitor B - Emerging Player',
|
||||
'Competitor C - Niche Specialist'
|
||||
]),
|
||||
'source': 'website_analysis',
|
||||
'confidence': website_data.get('confidence_level', 0.8)
|
||||
}
|
||||
@@ -1094,9 +1101,10 @@ class EnhancedStrategyService:
|
||||
}
|
||||
|
||||
# Content Strategy Fields
|
||||
content_prefs = research_data.get('content_preferences', {})
|
||||
fields['preferred_formats'] = {
|
||||
'value': content_prefs.get('preferred_formats', []),
|
||||
'value': content_prefs.get('preferred_formats', [
|
||||
'Blog posts', 'Whitepapers', 'Webinars', 'Case studies', 'Videos'
|
||||
]),
|
||||
'source': 'research_preferences',
|
||||
'confidence': research_data.get('confidence_level', 0.8)
|
||||
}
|
||||
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"files": {
|
||||
"main.css": "/static/css/main.c9966057.css",
|
||||
"main.js": "/static/js/main.cb1b37a5.js",
|
||||
"main.js": "/static/js/main.28afa9ad.js",
|
||||
"index.html": "/index.html",
|
||||
"main.c9966057.css.map": "/static/css/main.c9966057.css.map",
|
||||
"main.cb1b37a5.js.map": "/static/js/main.cb1b37a5.js.map"
|
||||
"main.28afa9ad.js.map": "/static/js/main.28afa9ad.js.map"
|
||||
},
|
||||
"entrypoints": [
|
||||
"static/css/main.c9966057.css",
|
||||
"static/js/main.cb1b37a5.js"
|
||||
"static/js/main.28afa9ad.js"
|
||||
]
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Alwrity - AI Content Creation Platform"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>Alwrity - AI Content Creation Platform</title><script defer="defer" src="/static/js/main.cb1b37a5.js"></script><link href="/static/css/main.c9966057.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Alwrity - AI Content Creation Platform"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>Alwrity - AI Content Creation Platform</title><script defer="defer" src="/static/js/main.28afa9ad.js"></script><link href="/static/css/main.c9966057.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
||||
+9
-9
@@ -1,5 +1,5 @@
|
||||
/*! For license information please see main.cb1b37a5.js.LICENSE.txt */
|
||||
(()=>{var e={219:(e,t,n)=>{"use strict";var r=n(3763),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var c=Object.defineProperty,d=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(m){var o=h(n);o&&o!==m&&e(t,o,r)}var a=d(n);u&&(a=a.concat(u(n)));for(var s=l(t),f=l(n),g=0;g<a.length;++g){var y=a[g];if(!i[y]&&(!r||!r[y])&&(!f||!f[y])&&(!s||!s[y])){var x=p(n,y);try{c(t,y,x)}catch(v){}}}}return t}},245:(e,t,n)=>{"use strict";n.d(t,{KH:()=>jt,uE:()=>wt,lE:()=>St});var r={};function o(e,t){return function(){return e.apply(t,arguments)}}n.r(r),n.d(r,{hasBrowserEnv:()=>ce,hasStandardBrowserEnv:()=>ue,hasStandardBrowserWebWorkerEnv:()=>pe,navigator:()=>de,origin:()=>he});const{toString:i}=Object.prototype,{getPrototypeOf:a}=Object,{iterator:s,toStringTag:l}=Symbol,c=(d=Object.create(null),e=>{const t=i.call(e);return d[t]||(d[t]=t.slice(8,-1).toLowerCase())});var d;const u=e=>(e=e.toLowerCase(),t=>c(t)===e),p=e=>t=>typeof t===e,{isArray:h}=Array,m=p("undefined");function f(e){return null!==e&&!m(e)&&null!==e.constructor&&!m(e.constructor)&&x(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const g=u("ArrayBuffer");const y=p("string"),x=p("function"),v=p("number"),b=e=>null!==e&&"object"===typeof e,w=e=>{if("object"!==c(e))return!1;const t=a(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(l in e)&&!(s in e)},j=u("Date"),S=u("File"),C=u("Blob"),k=u("FileList"),A=u("URLSearchParams"),[E,R,P,I]=["ReadableStream","Request","Response","Headers"].map(u);function T(e,t){let n,r,{allOwnKeys:o=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),h(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{if(f(e))return;const r=o?Object.getOwnPropertyNames(e):Object.keys(e),i=r.length;let a;for(n=0;n<i;n++)a=r[n],t.call(null,e[a],a,e)}}function M(e,t){if(f(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const _="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:"undefined"!==typeof window?window:global,z=e=>!m(e)&&e!==_;const O=(L="undefined"!==typeof Uint8Array&&a(Uint8Array),e=>L&&e instanceof L);var L;const $=u("HTMLFormElement"),D=(e=>{let{hasOwnProperty:t}=e;return(e,n)=>t.call(e,n)})(Object.prototype),N=u("RegExp"),F=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};T(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const B=u("AsyncFunction"),W=((e,t)=>{return e?setImmediate:t?(n=`axios@${Math.random()}`,r=[],_.addEventListener("message",e=>{let{source:t,data:o}=e;t===_&&o===n&&r.length&&r.shift()()},!1),e=>{r.push(e),_.postMessage(n,"*")}):e=>setTimeout(e);var n,r})("function"===typeof setImmediate,x(_.postMessage)),V="undefined"!==typeof queueMicrotask?queueMicrotask.bind(_):"undefined"!==typeof process&&process.nextTick||W,U={isArray:h,isArrayBuffer:g,isBuffer:f,isFormData:e=>{let t;return e&&("function"===typeof FormData&&e instanceof FormData||x(e.append)&&("formdata"===(t=c(e))||"object"===t&&x(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&g(e.buffer),t},isString:y,isNumber:v,isBoolean:e=>!0===e||!1===e,isObject:b,isPlainObject:w,isEmptyObject:e=>{if(!b(e)||f(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(t){return!1}},isReadableStream:E,isRequest:R,isResponse:P,isHeaders:I,isUndefined:m,isDate:j,isFile:S,isBlob:C,isRegExp:N,isFunction:x,isStream:e=>b(e)&&x(e.pipe),isURLSearchParams:A,isTypedArray:O,isFileList:k,forEach:T,merge:function e(){const{caseless:t}=z(this)&&this||{},n={},r=(r,o)=>{const i=t&&M(n,o)||o;w(n[i])&&w(r)?n[i]=e(n[i],r):w(r)?n[i]=e({},r):h(r)?n[i]=r.slice():n[i]=r};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&T(arguments[o],r);return n},extend:function(e,t,n){let{allOwnKeys:r}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return T(t,(t,r)=>{n&&x(t)?e[r]=o(t,n):e[r]=t},{allOwnKeys:r}),e},trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototypeLine truncated
|
||||
/*! For license information please see main.28afa9ad.js.LICENSE.txt */
|
||||
(()=>{var e={219:(e,t,n)=>{"use strict";var r=n(3763),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var c=Object.defineProperty,d=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(m){var o=h(n);o&&o!==m&&e(t,o,r)}var a=d(n);u&&(a=a.concat(u(n)));for(var s=l(t),f=l(n),g=0;g<a.length;++g){var y=a[g];if(!i[y]&&(!r||!r[y])&&(!f||!f[y])&&(!s||!s[y])){var x=p(n,y);try{c(t,y,x)}catch(v){}}}}return t}},245:(e,t,n)=>{"use strict";n.d(t,{KH:()=>jt,uE:()=>wt,lE:()=>St});var r={};function o(e,t){return function(){return e.apply(t,arguments)}}n.r(r),n.d(r,{hasBrowserEnv:()=>ce,hasStandardBrowserEnv:()=>ue,hasStandardBrowserWebWorkerEnv:()=>pe,navigator:()=>de,origin:()=>he});const{toString:i}=Object.prototype,{getPrototypeOf:a}=Object,{iterator:s,toStringTag:l}=Symbol,c=(d=Object.create(null),e=>{const t=i.call(e);return d[t]||(d[t]=t.slice(8,-1).toLowerCase())});var d;const u=e=>(e=e.toLowerCase(),t=>c(t)===e),p=e=>t=>typeof t===e,{isArray:h}=Array,m=p("undefined");function f(e){return null!==e&&!m(e)&&null!==e.constructor&&!m(e.constructor)&&x(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const g=u("ArrayBuffer");const y=p("string"),x=p("function"),v=p("number"),b=e=>null!==e&&"object"===typeof e,w=e=>{if("object"!==c(e))return!1;const t=a(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(l in e)&&!(s in e)},j=u("Date"),S=u("File"),C=u("Blob"),k=u("FileList"),A=u("URLSearchParams"),[E,R,P,I]=["ReadableStream","Request","Response","Headers"].map(u);function T(e,t){let n,r,{allOwnKeys:o=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),h(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{if(f(e))return;const r=o?Object.getOwnPropertyNames(e):Object.keys(e),i=r.length;let a;for(n=0;n<i;n++)a=r[n],t.call(null,e[a],a,e)}}function M(e,t){if(f(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const z="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:"undefined"!==typeof window?window:global,_=e=>!m(e)&&e!==z;const O=(L="undefined"!==typeof Uint8Array&&a(Uint8Array),e=>L&&e instanceof L);var L;const $=u("HTMLFormElement"),D=(e=>{let{hasOwnProperty:t}=e;return(e,n)=>t.call(e,n)})(Object.prototype),N=u("RegExp"),F=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};T(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const B=u("AsyncFunction"),W=((e,t)=>{return e?setImmediate:t?(n=`axios@${Math.random()}`,r=[],z.addEventListener("message",e=>{let{source:t,data:o}=e;t===z&&o===n&&r.length&&r.shift()()},!1),e=>{r.push(e),z.postMessage(n,"*")}):e=>setTimeout(e);var n,r})("function"===typeof setImmediate,x(z.postMessage)),V="undefined"!==typeof queueMicrotask?queueMicrotask.bind(z):"undefined"!==typeof process&&process.nextTick||W,U={isArray:h,isArrayBuffer:g,isBuffer:f,isFormData:e=>{let t;return e&&("function"===typeof FormData&&e instanceof FormData||x(e.append)&&("formdata"===(t=c(e))||"object"===t&&x(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&g(e.buffer),t},isString:y,isNumber:v,isBoolean:e=>!0===e||!1===e,isObject:b,isPlainObject:w,isEmptyObject:e=>{if(!b(e)||f(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(t){return!1}},isReadableStream:E,isRequest:R,isResponse:P,isHeaders:I,isUndefined:m,isDate:j,isFile:S,isBlob:C,isRegExp:N,isFunction:x,isStream:e=>b(e)&&x(e.pipe),isURLSearchParams:A,isTypedArray:O,isFileList:k,forEach:T,merge:function e(){const{caseless:t}=_(this)&&this||{},n={},r=(r,o)=>{const i=t&&M(n,o)||o;w(n[i])&&w(r)?n[i]=e(n[i],r):w(r)?n[i]=e({},r):h(r)?n[i]=r.slice():n[i]=r};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&T(arguments[o],r);return n},extend:function(e,t,n){let{allOwnKeys:r}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return T(t,(t,r)=>{n&&x(t)?e[r]=o(t,n):e[r]=t},{allOwnKeys:r}),e},trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototypeLine truncated
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
animation: ${0} 1.4s linear infinite;
|
||||
`),gn)}),vn=sn("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),bn=sn("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${nn(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(e=>{let{ownerState:t,theme:n}=e;return(0,o.A)({stroke:"currentColor"},"determinate"===t.variant&&{transition:n.transitions.create("stroke-dashoffset")},"indeterminate"===t.variant&&{strokeDasharray:"80px, 200px",strokeDashoffset:0})},e=>{let{ownerState:t}=e;return"indeterminate"===t.variant&&!t.disableShrink&&(0,en.AH)(hn||(hn=mn`
|
||||
animation: ${0} 1.4s ease-in-out infinite;
|
||||
`),yn)}),wn=e.forwardRef(function(e,t){const n=ve({props:e,name:"MuiCircularProgress"}),{className:r,color:a="primary",disableShrink:s=!1,size:l=40,style:c,thickness:d=3.6,value:u=0,variant:p="indeterminate"}=n,h=(0,i.A)(n,cn),m=(0,o.A)({},n,{color:a,disableShrink:s,size:l,thickness:d,value:u,variant:p}),f=(e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e;return Zt({root:["root",n,`color${nn(r)}`],svg:["svg"],circle:["circle",`circle${nn(n)}`,o&&"circleDisableShrink"]},ln,t)})(m),g={},y={},x={};if("determinate"===p){const e=2*Math.PI*((fn-d)/2);g.strokeDasharray=e.toFixed(3),x["aria-valuenow"]=Math.round(u),g.strokeDashoffset=`${((100-u)/100*e).toFixed(3)}px`,y.transform="rotate(-90deg)"}return(0,H.jsx)(xn,(0,o.A)({className:Bt(f.root,r),style:(0,o.A)({width:l,height:l},y,c),ownerState:m,ref:t,role:"progressbar"},x,h,{children:(0,H.jsx)(vn,{className:f.svg,ownerState:m,viewBox:"22 22 44 44",children:(0,H.jsx)(bn,{className:f.circle,style:g,ownerState:m,cx:fn,cy:fn,r:(fn-d)/2,fill:"none",strokeWidth:d})})}))}),jn=wn;function Sn(e){return Kt("MuiTypography",e)}Gt("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const Cn=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],kn=sn("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],"inherit"!==n.align&&t[`align${nn(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(e=>{let{theme:t,ownerState:n}=e;return(0,o.A)({margin:0},"inherit"===n.variant&&{font:"inherit"},"inherit"!==n.variant&&t.typography[n.variant],"inherit"!==n.align&&{textAlign:n.align},n.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n.gutterBottom&&{marginBottom:"0.35em"},n.paragraph&&{marginBottom:16})}),An={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},En={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Rn=e.forwardRef(function(e,t){const n=ve({props:e,name:"MuiTypography"}),r=(e=>En[e]||e)(n.color),a=(0,Wt.A)((0,o.A)({},n,{color:r})),{align:s="inherit",className:l,component:c,gutterBottom:d=!1,noWrap:u=!1,paragraph:p=!1,variant:h="body1",variantMapping:m=An}=a,f=(0,i.A)(a,Cn),g=(0,o.A)({},a,{align:s,color:r,className:l,component:c,gutterBottom:d,noWrap:u,paragraph:p,variant:h,variantMapping:m}),y=c||(p?"p":m[h]||An[h])||"span",x=(e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:o,variant:i,classes:a}=e;return Zt({root:["root",i,"inherit"!==e.align&&`align${nn(t)}`,n&&"gutterBottom",r&&"noWrap",o&&"paragraph"]},Sn,a)})(g);return(0,H.jsx)(kn,(0,o.A)({as:y,ref:t,ownerState:g,className:Bt(x.root,l)},f))}),Pn=Rn;function In(){const e=de(be);return e[ge]||e}function Tn(e){const{theme:t,name:n,props:r}=e;return t&&t.components&&t.components[n]&&t.components[n].defaultProps?Z(t.components[n].defaultProps,r):r}function Mn(t,n,r,o,i){const[a,s]=e.useState(()=>i&&r?r(t).matches:o?o(t).matches:n);return re(()=>{let e=!0;if(!r)return;const n=r(t),o=()=>{e&&s(n.matches)};return o(),n.addListener(o),()=>{e=!1,n.removeListener(o)}},[t,r]),a}const _n=t.useSyncExternalStore;function zn(t,n,r,o,i){const a=e.useCallback(()=>n,[n]),s=e.useMemo(()=>{if(i&&r)return()=>r(t).matches;if(null!==o){const{matches:e}=o(t);return()=>e}return a},[a,t,o,i,r]),[l,c]=e.useMemo(()=>{if(null===r)return[a,()=>()=>{}];const e=r(t);return[()=>e.matches,t=>(e.addListener(t),()=>{e.removeListener(t)})]},[a,r,t]);return _n(c,l,s)}function On(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=G(),r="undefined"!==typeof window&&"undefined"!==typeof window.matchMedia,{defaultMatches:o=!1,matchMedia:i=(r?window.matchMedia:null),ssrMatchMedia:a=null,noSsr:s=!1}=Tn({name:"MuiUseMediaQuery",props:t,theme:n});let l="function"===typeof e?e(n):e;l=l.replace(/^@media( ?)/m,"");return(void 0!==_n?zn:Mn)(l,o,i,a,s)}function Ln(e,t){return Ln=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ln(e,t)}function $n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ln(e,t)}const Dn=!1,Nn=e.createContext(null);var Fn="unmounted",Bn="exited",Wn="entering",Vn="entered",Un="exiting",Hn=function(t){function n(e,n){var r;r=t.call(this,e,n)||this;var o,i=n&&!n.isMounting?e.enter:e.appear;return r.appearStatus=null,e.in?i?(o=Bn,r.appearStatus=Wn):o=Vn:o=e.unmountOnExit||e.mountOnEnter?Fn:Bn,r.state={status:o},r.nextCallback=null,r}$n(n,t),n.getDerivedStateFromProps=function(e,t){return e.in&&t.status===Fn?{status:Bn}:null};var r=n.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(e){var t=null;if(e!==this
Line truncated
|
||||
`),yn)}),wn=e.forwardRef(function(e,t){const n=ve({props:e,name:"MuiCircularProgress"}),{className:r,color:a="primary",disableShrink:s=!1,size:l=40,style:c,thickness:d=3.6,value:u=0,variant:p="indeterminate"}=n,h=(0,i.A)(n,cn),m=(0,o.A)({},n,{color:a,disableShrink:s,size:l,thickness:d,value:u,variant:p}),f=(e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e;return Zt({root:["root",n,`color${nn(r)}`],svg:["svg"],circle:["circle",`circle${nn(n)}`,o&&"circleDisableShrink"]},ln,t)})(m),g={},y={},x={};if("determinate"===p){const e=2*Math.PI*((fn-d)/2);g.strokeDasharray=e.toFixed(3),x["aria-valuenow"]=Math.round(u),g.strokeDashoffset=`${((100-u)/100*e).toFixed(3)}px`,y.transform="rotate(-90deg)"}return(0,H.jsx)(xn,(0,o.A)({className:Bt(f.root,r),style:(0,o.A)({width:l,height:l},y,c),ownerState:m,ref:t,role:"progressbar"},x,h,{children:(0,H.jsx)(vn,{className:f.svg,ownerState:m,viewBox:"22 22 44 44",children:(0,H.jsx)(bn,{className:f.circle,style:g,ownerState:m,cx:fn,cy:fn,r:(fn-d)/2,fill:"none",strokeWidth:d})})}))}),jn=wn;function Sn(e){return Kt("MuiTypography",e)}Gt("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const Cn=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],kn=sn("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],"inherit"!==n.align&&t[`align${nn(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(e=>{let{theme:t,ownerState:n}=e;return(0,o.A)({margin:0},"inherit"===n.variant&&{font:"inherit"},"inherit"!==n.variant&&t.typography[n.variant],"inherit"!==n.align&&{textAlign:n.align},n.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n.gutterBottom&&{marginBottom:"0.35em"},n.paragraph&&{marginBottom:16})}),An={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},En={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Rn=e.forwardRef(function(e,t){const n=ve({props:e,name:"MuiTypography"}),r=(e=>En[e]||e)(n.color),a=(0,Wt.A)((0,o.A)({},n,{color:r})),{align:s="inherit",className:l,component:c,gutterBottom:d=!1,noWrap:u=!1,paragraph:p=!1,variant:h="body1",variantMapping:m=An}=a,f=(0,i.A)(a,Cn),g=(0,o.A)({},a,{align:s,color:r,className:l,component:c,gutterBottom:d,noWrap:u,paragraph:p,variant:h,variantMapping:m}),y=c||(p?"p":m[h]||An[h])||"span",x=(e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:o,variant:i,classes:a}=e;return Zt({root:["root",i,"inherit"!==e.align&&`align${nn(t)}`,n&&"gutterBottom",r&&"noWrap",o&&"paragraph"]},Sn,a)})(g);return(0,H.jsx)(kn,(0,o.A)({as:y,ref:t,ownerState:g,className:Bt(x.root,l)},f))}),Pn=Rn;function In(){const e=de(be);return e[ge]||e}function Tn(e){const{theme:t,name:n,props:r}=e;return t&&t.components&&t.components[n]&&t.components[n].defaultProps?Z(t.components[n].defaultProps,r):r}function Mn(t,n,r,o,i){const[a,s]=e.useState(()=>i&&r?r(t).matches:o?o(t).matches:n);return re(()=>{let e=!0;if(!r)return;const n=r(t),o=()=>{e&&s(n.matches)};return o(),n.addListener(o),()=>{e=!1,n.removeListener(o)}},[t,r]),a}const zn=t.useSyncExternalStore;function _n(t,n,r,o,i){const a=e.useCallback(()=>n,[n]),s=e.useMemo(()=>{if(i&&r)return()=>r(t).matches;if(null!==o){const{matches:e}=o(t);return()=>e}return a},[a,t,o,i,r]),[l,c]=e.useMemo(()=>{if(null===r)return[a,()=>()=>{}];const e=r(t);return[()=>e.matches,t=>(e.addListener(t),()=>{e.removeListener(t)})]},[a,r,t]);return zn(c,l,s)}function On(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=G(),r="undefined"!==typeof window&&"undefined"!==typeof window.matchMedia,{defaultMatches:o=!1,matchMedia:i=(r?window.matchMedia:null),ssrMatchMedia:a=null,noSsr:s=!1}=Tn({name:"MuiUseMediaQuery",props:t,theme:n});let l="function"===typeof e?e(n):e;l=l.replace(/^@media( ?)/m,"");return(void 0!==zn?_n:Mn)(l,o,i,a,s)}function Ln(e,t){return Ln=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ln(e,t)}function $n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ln(e,t)}const Dn=!1,Nn=e.createContext(null);var Fn="unmounted",Bn="exited",Wn="entering",Vn="entered",Un="exiting",Hn=function(t){function n(e,n){var r;r=t.call(this,e,n)||this;var o,i=n&&!n.isMounting?e.enter:e.appear;return r.appearStatus=null,e.in?i?(o=Bn,r.appearStatus=Wn):o=Vn:o=e.unmountOnExit||e.mountOnEnter?Fn:Bn,r.state={status:o},r.nextCallback=null,r}$n(n,t),n.getDerivedStateFromProps=function(e,t){return e.in&&t.status===Fn?{status:Bn}:null};var r=n.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(e){var t=null;if(e!==this
Line truncated
|
||||
0% {
|
||||
left: -35%;
|
||||
right: 100%;
|
||||
@@ -73,13 +73,13 @@
|
||||
}
|
||||
`)),Ir=(e,t)=>"inherit"===t?"currentColor":e.vars?e.vars.palette.LinearProgress[`${t}Bg`]:"light"===e.palette.mode?(0,p.a)(e.palette[t].main,.62):(0,p.e$)(e.palette[t].main,.5),Tr=sn("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${nn(n.color)}`],t[n.variant]]}})(e=>{let{ownerState:t,theme:n}=e;return(0,o.A)({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},backgroundColor:Ir(n,t.color)},"inherit"===t.color&&"buffer"!==t.variant&&{backgroundColor:"none","&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}},"buffer"===t.variant&&{backgroundColor:"transparent"},"query"===t.variant&&{transform:"rotate(180deg)"})}),Mr=sn("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.dashed,t[`dashedColor${nn(n.color)}`]]}})(e=>{let{ownerState:t,theme:n}=e;const r=Ir(n,t.color);return(0,o.A)({position:"absolute",marginTop:0,height:"100%",width:"100%"},"inherit"===t.color&&{opacity:.3},{backgroundImage:`radial-gradient(${r} 0%, ${r} 16%, transparent 42%)`,backgroundSize:"10px 10px",backgroundPosition:"0 -23px"})},(0,en.AH)(Sr||(Sr=Ar`
|
||||
animation: ${0} 3s infinite linear;
|
||||
`),Pr)),_r=sn("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.bar,t[`barColor${nn(n.color)}`],("indeterminate"===n.variant||"query"===n.variant)&&t.bar1Indeterminate,"determinate"===n.variant&&t.bar1Determinate,"buffer"===n.variant&&t.bar1Buffer]}})(e=>{let{ownerState:t,theme:n}=e;return(0,o.A)({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",backgroundColor:"inherit"===t.color?"currentColor":(n.vars||n).palette[t.color].main},"determinate"===t.variant&&{transition:"transform .4s linear"},"buffer"===t.variant&&{zIndex:1,transition:"transform .4s linear"})},e=>{let{ownerState:t}=e;return("indeterminate"===t.variant||"query"===t.variant)&&(0,en.AH)(Cr||(Cr=Ar`
|
||||
`),Pr)),zr=sn("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.bar,t[`barColor${nn(n.color)}`],("indeterminate"===n.variant||"query"===n.variant)&&t.bar1Indeterminate,"determinate"===n.variant&&t.bar1Determinate,"buffer"===n.variant&&t.bar1Buffer]}})(e=>{let{ownerState:t,theme:n}=e;return(0,o.A)({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",backgroundColor:"inherit"===t.color?"currentColor":(n.vars||n).palette[t.color].main},"determinate"===t.variant&&{transition:"transform .4s linear"},"buffer"===t.variant&&{zIndex:1,transition:"transform .4s linear"})},e=>{let{ownerState:t}=e;return("indeterminate"===t.variant||"query"===t.variant)&&(0,en.AH)(Cr||(Cr=Ar`
|
||||
width: auto;
|
||||
animation: ${0} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
|
||||
`),Er)}),zr=sn("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.bar,t[`barColor${nn(n.color)}`],("indeterminate"===n.variant||"query"===n.variant)&&t.bar2Indeterminate,"buffer"===n.variant&&t.bar2Buffer]}})(e=>{let{ownerState:t,theme:n}=e;return(0,o.A)({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left"},"buffer"!==t.variant&&{backgroundColor:"inherit"===t.color?"currentColor":(n.vars||n).palette[t.color].main},"inherit"===t.color&&{opacity:.3},"buffer"===t.variant&&{backgroundColor:Ir(n,t.color),transition:"transform .4s linear"})},e=>{let{ownerState:t}=e;return("indeterminate"===t.variant||"query"===t.variant)&&(0,en.AH)(kr||(kr=Ar`
|
||||
`),Er)}),_r=sn("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.bar,t[`barColor${nn(n.color)}`],("indeterminate"===n.variant||"query"===n.variant)&&t.bar2Indeterminate,"buffer"===n.variant&&t.bar2Buffer]}})(e=>{let{ownerState:t,theme:n}=e;return(0,o.A)({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left"},"buffer"!==t.variant&&{backgroundColor:"inherit"===t.color?"currentColor":(n.vars||n).palette[t.color].main},"inherit"===t.color&&{opacity:.3},"buffer"===t.variant&&{backgroundColor:Ir(n,t.color),transition:"transform .4s linear"})},e=>{let{ownerState:t}=e;return("indeterminate"===t.variant||"query"===t.variant)&&(0,en.AH)(kr||(kr=Ar`
|
||||
width: auto;
|
||||
animation: ${0} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
|
||||
`),Rr)}),Or=e.forwardRef(function(e,t){const n=ve({props:e,name:"MuiLinearProgress"}),{className:r,color:a="primary",value:s,valueBuffer:l,variant:c="indeterminate"}=n,d=(0,i.A)(n,vr),u=(0,o.A)({},n,{color:a,variant:c}),p=(e=>{const{classes:t,variant:n,color:r}=e;return Zt({root:["root",`color${nn(r)}`,n],dashed:["dashed",`dashedColor${nn(r)}`],bar1:["bar",`barColor${nn(r)}`,("indeterminate"===n||"query"===n)&&"bar1Indeterminate","determinate"===n&&"bar1Determinate","buffer"===n&&"bar1Buffer"],bar2:["bar","buffer"!==n&&`barColor${nn(r)}`,"buffer"===n&&`color${nn(r)}`,("indeterminate"===n||"query"===n)&&"bar2Indeterminate","buffer"===n&&"bar2Buffer"]},xr,t)})(u),h=Q(),m={},f={bar1:{},bar2:{}};if("determinate"===c||"buffer"===c)if(void 0!==s){m["aria-valuenow"]=Math.round(s),m["aria-valuemin"]=0,m["aria-valuemax"]=100;let e=s-100;h&&(e=-e),f.bar1.transform=`translateX(${e}%)`}else 0;if("buffer"===c)if(void 0!==l){let e=(l||0)-100;h&&(e=-e),f.bar2.transform=`translateX(${e}%)`}else 0;return(0,H.jsxs)(Tr,(0,o.A)({className:Bt(p.root,r),ownerState:u,role:"progressbar"},m,{ref:t},d,{children:["buffer"===c?(0,H.jsx)(Mr,{className:p.dashed,ownerState:u}):null,(0,H.jsx)(_r,{className:p.bar1,ownerState:u,style:f.bar1}),"determinate"===c?null:(0,H.jsx)(zr,{className:p.bar2,ownerState:u,style:f.bar2})]}))}),Lr=Or,$r={};const Dr=[];class Nr{constructor(){this.currentId=null,this.clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new Nr}start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,t()},e)}}function Fr(){const t=function(t,n){const r=e.useRef($r);return r.current===$r&&(r.current=t(n)),r}(Nr.create).current;var n;return n=t.disposeEffect,e.useEffect(n,Dr),t}const Br=function(e){return"string"===typeof e};const Wr=function(e,t,n){return void 0===e||Br(e)?t:(0,o.A)({},t,{ownerState:(0,o.A)({},t.ownerState,n)})},Vr=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function Ur(e){return`scale(${e}, ${e**2})`}const Hr={entering:{opacity:1,transform:Ur(1)},entered:{opacity:1,transform:"none"}},qr="undefined"!==typeof navigator&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Kr=e.forwardRef(function(t,n){const{addEndListener:r,appear:a=!0,children:s,easing:l,in:c,onEnter:d,onEntered:u,onEntering:p,onExit:h,onExited:m,onExiting:f,style:g,timeout:y="auto",TransitionComponent:x=Kn}=t,v=(0,i.A)(t,Vr),b=Fr(),w=e.useRef(),j=In(),S=e.useRef(null),C=Zn(S,Gn(s),n),k=e=>t=>{if(e){const n=S.current;void 0===t?e(n):e(n,t)}},A=k(p),E=k((e,t)=>{er(e);const{duration:n,delay:r,easing:o}=tr({style:g,timeout:y,easing:l},{mode:"enter"});let i;"auto"===y?(i=j.transitions.getAutoHeightDuration(e.clientHeight),w.current=i):i=n,e.style.transition=[j.transitions.create("opacity",{duration:i,delay:r}),j.transitions.create("transform",{duration:qr?i:.666*i,delay:r,easing:o})].join(","),d&&d(e,t)}),R=k(u),P=k(f),I=k(e=>{const{duration:t,delay:n,easing:r}=tr({style:g,timeout:y,easing:l},{mode:"exit"});let o;"auto"===y?(o=j.transitions.getAutoHeightDuration(e.clientHeight),w.current=o):o=t,e.style.transition=[j.transitions.create("opacity",{duration:o,delay:n}),j.transitions.create("transform",{duration:qr?o:.666*o,delay:qr?n:n||.333*o,easing:r})].join(","),e.style.opacity=0,e.style.transform=Ur(.75),h&&h(e)}),T=k(m);return(0,H.jsx)(x,(0,o.A)({appear:a,in:c,nodeRef:S,onEnter:E,onEntered:R,onEntering:A,onExit:I,onExited:T,onExiting:P,addEndListener:e=>{"auto"===y&&b.start(w.current||0,e),r&&r(S.current,e)},timeout:"auto"===y?null:y},v,{children:(t,n)=>e.cloneElement(s,(0,o.A)({style:(0,o.A)({opacity:0,transform:Ur(.75),visibility:"exited"!==t||c?void 0:"hidden"},Hr[t],g,s.props.style),ref:C},n))}))});Kr.muiSupportAuto=!0;const Gr=Kr;var Xr=n(2374);function Yr(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Qr(e){return e instanceof Yr(e).Element||e instanceof Element}function Jr(e){return e instanceof Yr(e).HTMLElement||e instanceof HTMLElement}function Zr(e){return"undefined"!==typeof ShadowRoot&&(e instanceof Yr(e).ShadowRoot||e instanceof ShadowRoot)}var eo=Math.max,to=Math.min,no=Math.round;function ro(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function oo(){return!/^((?!chrome|android).)*safari/i.test(ro())}function io(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&Jr(e)&&(o=e.offsetWidth>0&&no(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&no(r.height)/e.offsetHeight||1);var a=(Qr(e)?Yr(e):window).visualViewport,s=!oo()&&n,l=(r.left+(s&&a?a.offsetLeft:0))/o,c=(r.top+(s&&a?a.offsetTop:0))/i,d=r.wid
Line truncated
|
||||
`),Rr)}),Or=e.forwardRef(function(e,t){const n=ve({props:e,name:"MuiLinearProgress"}),{className:r,color:a="primary",value:s,valueBuffer:l,variant:c="indeterminate"}=n,d=(0,i.A)(n,vr),u=(0,o.A)({},n,{color:a,variant:c}),p=(e=>{const{classes:t,variant:n,color:r}=e;return Zt({root:["root",`color${nn(r)}`,n],dashed:["dashed",`dashedColor${nn(r)}`],bar1:["bar",`barColor${nn(r)}`,("indeterminate"===n||"query"===n)&&"bar1Indeterminate","determinate"===n&&"bar1Determinate","buffer"===n&&"bar1Buffer"],bar2:["bar","buffer"!==n&&`barColor${nn(r)}`,"buffer"===n&&`color${nn(r)}`,("indeterminate"===n||"query"===n)&&"bar2Indeterminate","buffer"===n&&"bar2Buffer"]},xr,t)})(u),h=Q(),m={},f={bar1:{},bar2:{}};if("determinate"===c||"buffer"===c)if(void 0!==s){m["aria-valuenow"]=Math.round(s),m["aria-valuemin"]=0,m["aria-valuemax"]=100;let e=s-100;h&&(e=-e),f.bar1.transform=`translateX(${e}%)`}else 0;if("buffer"===c)if(void 0!==l){let e=(l||0)-100;h&&(e=-e),f.bar2.transform=`translateX(${e}%)`}else 0;return(0,H.jsxs)(Tr,(0,o.A)({className:Bt(p.root,r),ownerState:u,role:"progressbar"},m,{ref:t},d,{children:["buffer"===c?(0,H.jsx)(Mr,{className:p.dashed,ownerState:u}):null,(0,H.jsx)(zr,{className:p.bar1,ownerState:u,style:f.bar1}),"determinate"===c?null:(0,H.jsx)(_r,{className:p.bar2,ownerState:u,style:f.bar2})]}))}),Lr=Or,$r={};const Dr=[];class Nr{constructor(){this.currentId=null,this.clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new Nr}start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,t()},e)}}function Fr(){const t=function(t,n){const r=e.useRef($r);return r.current===$r&&(r.current=t(n)),r}(Nr.create).current;var n;return n=t.disposeEffect,e.useEffect(n,Dr),t}const Br=function(e){return"string"===typeof e};const Wr=function(e,t,n){return void 0===e||Br(e)?t:(0,o.A)({},t,{ownerState:(0,o.A)({},t.ownerState,n)})},Vr=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function Ur(e){return`scale(${e}, ${e**2})`}const Hr={entering:{opacity:1,transform:Ur(1)},entered:{opacity:1,transform:"none"}},qr="undefined"!==typeof navigator&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Kr=e.forwardRef(function(t,n){const{addEndListener:r,appear:a=!0,children:s,easing:l,in:c,onEnter:d,onEntered:u,onEntering:p,onExit:h,onExited:m,onExiting:f,style:g,timeout:y="auto",TransitionComponent:x=Kn}=t,v=(0,i.A)(t,Vr),b=Fr(),w=e.useRef(),j=In(),S=e.useRef(null),C=Zn(S,Gn(s),n),k=e=>t=>{if(e){const n=S.current;void 0===t?e(n):e(n,t)}},A=k(p),E=k((e,t)=>{er(e);const{duration:n,delay:r,easing:o}=tr({style:g,timeout:y,easing:l},{mode:"enter"});let i;"auto"===y?(i=j.transitions.getAutoHeightDuration(e.clientHeight),w.current=i):i=n,e.style.transition=[j.transitions.create("opacity",{duration:i,delay:r}),j.transitions.create("transform",{duration:qr?i:.666*i,delay:r,easing:o})].join(","),d&&d(e,t)}),R=k(u),P=k(f),I=k(e=>{const{duration:t,delay:n,easing:r}=tr({style:g,timeout:y,easing:l},{mode:"exit"});let o;"auto"===y?(o=j.transitions.getAutoHeightDuration(e.clientHeight),w.current=o):o=t,e.style.transition=[j.transitions.create("opacity",{duration:o,delay:n}),j.transitions.create("transform",{duration:qr?o:.666*o,delay:qr?n:n||.333*o,easing:r})].join(","),e.style.opacity=0,e.style.transform=Ur(.75),h&&h(e)}),T=k(m);return(0,H.jsx)(x,(0,o.A)({appear:a,in:c,nodeRef:S,onEnter:E,onEntered:R,onEntering:A,onExit:I,onExited:T,onExiting:P,addEndListener:e=>{"auto"===y&&b.start(w.current||0,e),r&&r(S.current,e)},timeout:"auto"===y?null:y},v,{children:(t,n)=>e.cloneElement(s,(0,o.A)({style:(0,o.A)({opacity:0,transform:Ur(.75),visibility:"exited"!==t||c?void 0:"hidden"},Hr[t],g,s.props.style),ref:C},n))}))});Kr.muiSupportAuto=!0;const Gr=Kr;var Xr=n(2374);function Yr(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Qr(e){return e instanceof Yr(e).Element||e instanceof Element}function Jr(e){return e instanceof Yr(e).HTMLElement||e instanceof HTMLElement}function Zr(e){return"undefined"!==typeof ShadowRoot&&(e instanceof Yr(e).ShadowRoot||e instanceof ShadowRoot)}var eo=Math.max,to=Math.min,no=Math.round;function ro(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function oo(){return!/^((?!chrome|android).)*safari/i.test(ro())}function io(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&Jr(e)&&(o=e.offsetWidth>0&&no(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&no(r.height)/e.offsetHeight||1);var a=(Qr(e)?Yr(e):window).visualViewport,s=!oo()&&n,l=(r.left+(s&&a?a.offsetLeft:0))/o,c=(r.top+(s&&a?a.offsetTop:0))/i,d=r.wid
Line truncated
|
||||
0% {
|
||||
transform: scale(0);
|
||||
opacity: 0.1;
|
||||
@@ -152,7 +152,7 @@
|
||||
animation-iteration-count: infinite;
|
||||
animation-delay: 200ms;
|
||||
}
|
||||
`),ca.rippleVisible,ga,550,e=>{let{theme:t}=e;return t.transitions.easing.easeInOut},ca.ripplePulsate,e=>{let{theme:t}=e;return t.transitions.duration.shorter},ca.child,ca.childLeaving,ya,550,e=>{let{theme:t}=e;return t.transitions.easing.easeInOut},ca.childPulsate,xa,e=>{let{theme:t}=e;return t.transitions.easing.easeInOut}),wa=e.forwardRef(function(t,n){const r=ve({props:t,name:"MuiTouchRipple"}),{center:a=!1,classes:s={},className:l}=r,c=(0,i.A)(r,da),[d,u]=e.useState([]),p=e.useRef(0),h=e.useRef(null);e.useEffect(()=>{h.current&&(h.current(),h.current=null)},[d]);const m=e.useRef(!1),f=Fr(),g=e.useRef(null),y=e.useRef(null),x=e.useCallback(e=>{const{pulsate:t,rippleX:n,rippleY:r,rippleSize:o,cb:i}=e;u(e=>[...e,(0,H.jsx)(ba,{classes:{ripple:Bt(s.ripple,ca.ripple),rippleVisible:Bt(s.rippleVisible,ca.rippleVisible),ripplePulsate:Bt(s.ripplePulsate,ca.ripplePulsate),child:Bt(s.child,ca.child),childLeaving:Bt(s.childLeaving,ca.childLeaving),childPulsate:Bt(s.childPulsate,ca.childPulsate)},timeout:550,pulsate:t,rippleX:n,rippleY:r,rippleSize:o},p.current)]),p.current+=1,h.current=i},[s]),v=e.useCallback(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{};const{pulsate:r=!1,center:o=a||t.pulsate,fakeElement:i=!1}=t;if("mousedown"===(null==e?void 0:e.type)&&m.current)return void(m.current=!1);"touchstart"===(null==e?void 0:e.type)&&(m.current=!0);const s=i?null:y.current,l=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0};let c,d,u;if(o||void 0===e||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)c=Math.round(l.width/2),d=Math.round(l.height/2);else{const{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;c=Math.round(t-l.left),d=Math.round(n-l.top)}if(o)u=Math.sqrt((2*l.width**2+l.height**2)/3),u%2===0&&(u+=1);else{const e=2*Math.max(Math.abs((s?s.clientWidth:0)-c),c)+2,t=2*Math.max(Math.abs((s?s.clientHeight:0)-d),d)+2;u=Math.sqrt(e**2+t**2)}null!=e&&e.touches?null===g.current&&(g.current=()=>{x({pulsate:r,rippleX:c,rippleY:d,rippleSize:u,cb:n})},f.start(80,()=>{g.current&&(g.current(),g.current=null)})):x({pulsate:r,rippleX:c,rippleY:d,rippleSize:u,cb:n})},[a,x,f]),b=e.useCallback(()=>{v({},{pulsate:!0})},[v]),w=e.useCallback((e,t)=>{if(f.clear(),"touchend"===(null==e?void 0:e.type)&&g.current)return g.current(),g.current=null,void f.start(0,()=>{w(e,t)});g.current=null,u(e=>e.length>0?e.slice(1):e),h.current=t},[f]);return e.useImperativeHandle(n,()=>({pulsate:b,start:v,stop:w}),[b,v,w]),(0,H.jsx)(va,(0,o.A)({className:Bt(ca.root,s.root,l),ref:y},c,{children:(0,H.jsx)(sa,{component:null,exit:!0,children:d})}))}),ja=wa;function Sa(e){return Kt("MuiButtonBase",e)}const Ca=Gt("MuiButtonBase",["root","disabled","focusVisible"]),ka=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],Aa=sn("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Ca.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Ea=e.forwardRef(function(t,n){const r=ve({props:t,name:"MuiButtonBase"}),{action:a,centerRipple:s=!1,children:l,className:c,component:d="button",disabled:u=!1,disableRipple:p=!1,disableTouchRipple:h=!1,focusRipple:m=!1,LinkComponent:f="a",onBlur:g,onClick:y,onContextMenu:x,onDragLeave:v,onFocus:b,onFocusVisible:w,onKeyDown:j,onKeyUp:S,onMouseDown:C,onMouseLeave:k,onMouseUp:A,onTouchEnd:E,onTouchMove:R,onTouchStart:P,tabIndex:I=0,TouchRippleProps:T,touchRippleRef:M,type:_}=r,z=(0,i.A)(r,ka),O=e.useRef(null),L=e.useRef(null),$=Zn(L,M),{isFocusVisibleRef:D,onFocus:N,onBlur:F,ref:B}=Bi(),[W,V]=e.useState(!1);u&&W&&V(!1),e.useImperativeHandle(a,()=>({focusVisible:()=>{V(!0),O.current.focus()}}),[]);const[U,q]=e.useState(!1);e.useEffect(()=>{q(!0)},[]);const K=U&&!p&&!u;function G(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;return Ti(r=>{t&&t(r);return!n&&L.current&&L.current[e](r),!0})}e.useEffect(()=>{W&&m&&!p&&U&&L.current.pulsate()},[p,m,W,U]);const X=G("start",C),Y=G("stop",x),Q=G("stop",v),J=G("stop",A),Z=G("stop",e=>{W&&e.preventDefault(),k&&k(e)}),ee=G("start",P),te=G("stop",E),ne=G("stop",R),re=G("stop",e=>
Line truncated
|
||||
`),ca.rippleVisible,ga,550,e=>{let{theme:t}=e;return t.transitions.easing.easeInOut},ca.ripplePulsate,e=>{let{theme:t}=e;return t.transitions.duration.shorter},ca.child,ca.childLeaving,ya,550,e=>{let{theme:t}=e;return t.transitions.easing.easeInOut},ca.childPulsate,xa,e=>{let{theme:t}=e;return t.transitions.easing.easeInOut}),wa=e.forwardRef(function(t,n){const r=ve({props:t,name:"MuiTouchRipple"}),{center:a=!1,classes:s={},className:l}=r,c=(0,i.A)(r,da),[d,u]=e.useState([]),p=e.useRef(0),h=e.useRef(null);e.useEffect(()=>{h.current&&(h.current(),h.current=null)},[d]);const m=e.useRef(!1),f=Fr(),g=e.useRef(null),y=e.useRef(null),x=e.useCallback(e=>{const{pulsate:t,rippleX:n,rippleY:r,rippleSize:o,cb:i}=e;u(e=>[...e,(0,H.jsx)(ba,{classes:{ripple:Bt(s.ripple,ca.ripple),rippleVisible:Bt(s.rippleVisible,ca.rippleVisible),ripplePulsate:Bt(s.ripplePulsate,ca.ripplePulsate),child:Bt(s.child,ca.child),childLeaving:Bt(s.childLeaving,ca.childLeaving),childPulsate:Bt(s.childPulsate,ca.childPulsate)},timeout:550,pulsate:t,rippleX:n,rippleY:r,rippleSize:o},p.current)]),p.current+=1,h.current=i},[s]),v=e.useCallback(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{};const{pulsate:r=!1,center:o=a||t.pulsate,fakeElement:i=!1}=t;if("mousedown"===(null==e?void 0:e.type)&&m.current)return void(m.current=!1);"touchstart"===(null==e?void 0:e.type)&&(m.current=!0);const s=i?null:y.current,l=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0};let c,d,u;if(o||void 0===e||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)c=Math.round(l.width/2),d=Math.round(l.height/2);else{const{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;c=Math.round(t-l.left),d=Math.round(n-l.top)}if(o)u=Math.sqrt((2*l.width**2+l.height**2)/3),u%2===0&&(u+=1);else{const e=2*Math.max(Math.abs((s?s.clientWidth:0)-c),c)+2,t=2*Math.max(Math.abs((s?s.clientHeight:0)-d),d)+2;u=Math.sqrt(e**2+t**2)}null!=e&&e.touches?null===g.current&&(g.current=()=>{x({pulsate:r,rippleX:c,rippleY:d,rippleSize:u,cb:n})},f.start(80,()=>{g.current&&(g.current(),g.current=null)})):x({pulsate:r,rippleX:c,rippleY:d,rippleSize:u,cb:n})},[a,x,f]),b=e.useCallback(()=>{v({},{pulsate:!0})},[v]),w=e.useCallback((e,t)=>{if(f.clear(),"touchend"===(null==e?void 0:e.type)&&g.current)return g.current(),g.current=null,void f.start(0,()=>{w(e,t)});g.current=null,u(e=>e.length>0?e.slice(1):e),h.current=t},[f]);return e.useImperativeHandle(n,()=>({pulsate:b,start:v,stop:w}),[b,v,w]),(0,H.jsx)(va,(0,o.A)({className:Bt(ca.root,s.root,l),ref:y},c,{children:(0,H.jsx)(sa,{component:null,exit:!0,children:d})}))}),ja=wa;function Sa(e){return Kt("MuiButtonBase",e)}const Ca=Gt("MuiButtonBase",["root","disabled","focusVisible"]),ka=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],Aa=sn("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Ca.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Ea=e.forwardRef(function(t,n){const r=ve({props:t,name:"MuiButtonBase"}),{action:a,centerRipple:s=!1,children:l,className:c,component:d="button",disabled:u=!1,disableRipple:p=!1,disableTouchRipple:h=!1,focusRipple:m=!1,LinkComponent:f="a",onBlur:g,onClick:y,onContextMenu:x,onDragLeave:v,onFocus:b,onFocusVisible:w,onKeyDown:j,onKeyUp:S,onMouseDown:C,onMouseLeave:k,onMouseUp:A,onTouchEnd:E,onTouchMove:R,onTouchStart:P,tabIndex:I=0,TouchRippleProps:T,touchRippleRef:M,type:z}=r,_=(0,i.A)(r,ka),O=e.useRef(null),L=e.useRef(null),$=Zn(L,M),{isFocusVisibleRef:D,onFocus:N,onBlur:F,ref:B}=Bi(),[W,V]=e.useState(!1);u&&W&&V(!1),e.useImperativeHandle(a,()=>({focusVisible:()=>{V(!0),O.current.focus()}}),[]);const[U,q]=e.useState(!1);e.useEffect(()=>{q(!0)},[]);const K=U&&!p&&!u;function G(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;return Ti(r=>{t&&t(r);return!n&&L.current&&L.current[e](r),!0})}e.useEffect(()=>{W&&m&&!p&&U&&L.current.pulsate()},[p,m,W,U]);const X=G("start",C),Y=G("stop",x),Q=G("stop",v),J=G("stop",A),Z=G("stop",e=>{W&&e.preventDefault(),k&&k(e)}),ee=G("start",P),te=G("stop",E),ne=G("stop",R),re=G("stop",e=>
Line truncated
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
@@ -202,5 +202,5 @@
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
`),sk,(n.vars||n).palette.action.hover)}),ck=e.forwardRef(function(e,t){const n=ve({props:e,name:"MuiSkeleton"}),{animation:r="pulse",className:a,component:s="span",height:l,style:c,variant:d="text",width:u}=n,p=(0,i.A)(n,ek),h=(0,o.A)({},n,{animation:r,component:s,variant:d,hasChildren:Boolean(p.children)}),m=(e=>{const{classes:t,variant:n,animation:r,hasChildren:o,width:i,height:a}=e;return Zt({root:["root",n,r,o&&"withChildren",o&&!i&&"fitContent",o&&!a&&"heightAuto"]},ZC,t)})(h);return(0,H.jsx)(lk,(0,o.A)({as:s,ref:t,className:Bt(m.root,a),ownerState:h},p,{style:(0,o.A)({width:u,height:l},c)}))}),dk=ck,uk=e=>{let{itemCount:t=8,itemHeight:n=200,headerHeight:r=80}=e;return(0,H.jsx)(EC,{children:(0,H.jsx)(ll,{maxWidth:"xl",children:(0,H.jsxs)(Jt,{sx:{display:"flex",flexDirection:"column",gap:3},children:[(0,H.jsx)(dk,{variant:"rectangular",height:r,sx:{borderRadius:2}}),(0,H.jsx)(wl,{container:!0,spacing:3,children:Array.from({length:t}).map((e,t)=>(0,H.jsx)(wl,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,H.jsx)(dk,{variant:"rectangular",height:n,sx:{borderRadius:2}})},t))})]})})})},pk=e=>{let{error:t,onRetry:n,retryButtonText:r="Retry"}=e;return(0,H.jsx)(EC,{children:(0,H.jsxs)(ll,{maxWidth:"xl",children:[(0,H.jsx)(mh,{severity:"error",sx:{mb:3,borderRadius:2},children:t}),n&&(0,H.jsx)(zs,{onClick:n,variant:"contained",children:r})]})})},hk=e=>{let{title:t,message:n,onClearFilters:r,clearButtonText:o="Clear Filters"}=e;return(0,H.jsxs)(Jt,{sx:{textAlign:"center",py:8},children:[(0,H.jsx)(Pn,{variant:"h5",sx:{color:"rgba(255, 255, 255, 0.9)",mb:2,fontWeight:600},children:t}),(0,H.jsx)(Pn,{variant:"body1",sx:{color:"rgba(255, 255, 255, 0.7)",mb:3},children:n}),r&&(0,H.jsx)(zs,{variant:"outlined",onClick:r,sx:{color:"white",borderColor:"rgba(255, 255, 255, 0.3)","&:hover":{borderColor:"rgba(255, 255, 255, 0.5)",background:"rgba(255, 255, 255, 0.1)"}},children:o})]})},mk=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"===typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!==typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e))},a=t=e(r,o,i);return i},fk=e=>e;const gk=t=>{const n=(e=>e?mk(e):mk)(t),r=t=>function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fk;const r=e.useSyncExternalStore(t.subscribe,e.useCallback(()=>n(t.getState()),[t,n]),e.useCallback(()=>n(t.getInitialState()),[t,n]));return e.useDebugValue(r),r}(n,t);return Object.assign(r,n),r},yk=e=>e?gk(e):gk,xk=new Map,vk=e=>{const t=xk.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(e=>{let[t,n]=e;return[t,n.getState()]})):{}},bk=e=>{var t,n;if(!e)return;const r=e.split("\n"),o=r.findIndex(e=>e.includes("api.setState"));if(o<0)return;const i=(null==(t=r[o+1])?void 0:t.trim())||"";return null==(n=/.+ (.+) .+/.exec(i))?void 0:n[1]},wk=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(n,r,o)=>{const{enabled:i,anonymousActionType:a,store:s,...l}=t;let c;try{c=(null==i||i)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch(f){}if(!c)return e(n,r,o);const{connection:d,...u}=((e,t,n)=>{if(void 0===e)return{type:"untracked",connection:t.connect(n)};const r=xk.get(n.name);if(r)return{type:"tracked",store:e,...r};const o={connection:t.connect(n),stores:{}};return xk.set(n.name,o),{type:"tracked",store:e,...o}})(s,c,l);let p=!0;o.setState=(e,t,i)=>{const c=n(e,t);if(!p)return c;const u=void 0===i?{type:a||bk((new Error).stack)||"anonymous"}:"string"===typeof i?{type:i}:i;return void 0===s?(null==d||d.send(u,r()),c):(null==d||d.send({...u,type:`${s}/${u.type}`},{...vk(l.name),[s]:o.getState()}),c)},o.devtools={cleanup:()=>{d&&"function"===typeof d.unsubscribe&&d.unsubscribe(),((e,t)=>{if(void 0===t)return;const n=xk.get(e);n&&(delete n.stores[t],0===Object.keys(n.stores).length&&xk.delete(e))})(l.name,s)}};const h=function(){const e=p;p=!1,n(...arguments),p=e},m=e(o.setState,r,o);if("untracked"===u.type?null==d||d.init(m):(u.stores[u.store]=o,null==d||d.init(Object.fromEntries(Object.entries(u.stores).map(e=>{let[t,n]=e;return[t,t===u.store?m:n.getState()]})))),o.dispatchFromDevtools&&"function"===typeof o.dispatch){let e=!1;const t=o.dispatch;o.dispatch=function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];"__setState"!==r[0].type||e||(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),e=!0),t(...r)}}return d.subscribe(e=>{var t;switch(e.type){case"ACTION":return"string"!==typeof e.payload?void console.error("[zustand devtools middleware] Unsupported action format"):jk(e.payload,e=>{if("__setState"===e.type){if(void 0===s)return void h(e.state);1!==Object.keys(e.state).length&&console.error('\n [zustand devtools middleware] Unsupported __setState action format.\n When using \'store\' option in devtools(), the \'state\' should h
Line truncated
|
||||
//# sourceMappingURL=main.cb1b37a5.js.map
|
||||
`),sk,(n.vars||n).palette.action.hover)}),ck=e.forwardRef(function(e,t){const n=ve({props:e,name:"MuiSkeleton"}),{animation:r="pulse",className:a,component:s="span",height:l,style:c,variant:d="text",width:u}=n,p=(0,i.A)(n,ek),h=(0,o.A)({},n,{animation:r,component:s,variant:d,hasChildren:Boolean(p.children)}),m=(e=>{const{classes:t,variant:n,animation:r,hasChildren:o,width:i,height:a}=e;return Zt({root:["root",n,r,o&&"withChildren",o&&!i&&"fitContent",o&&!a&&"heightAuto"]},ZC,t)})(h);return(0,H.jsx)(lk,(0,o.A)({as:s,ref:t,className:Bt(m.root,a),ownerState:h},p,{style:(0,o.A)({width:u,height:l},c)}))}),dk=ck,uk=e=>{let{itemCount:t=8,itemHeight:n=200,headerHeight:r=80}=e;return(0,H.jsx)(EC,{children:(0,H.jsx)(ll,{maxWidth:"xl",children:(0,H.jsxs)(Jt,{sx:{display:"flex",flexDirection:"column",gap:3},children:[(0,H.jsx)(dk,{variant:"rectangular",height:r,sx:{borderRadius:2}}),(0,H.jsx)(wl,{container:!0,spacing:3,children:Array.from({length:t}).map((e,t)=>(0,H.jsx)(wl,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,H.jsx)(dk,{variant:"rectangular",height:n,sx:{borderRadius:2}})},t))})]})})})},pk=e=>{let{error:t,onRetry:n,retryButtonText:r="Retry"}=e;return(0,H.jsx)(EC,{children:(0,H.jsxs)(ll,{maxWidth:"xl",children:[(0,H.jsx)(mh,{severity:"error",sx:{mb:3,borderRadius:2},children:t}),n&&(0,H.jsx)(_s,{onClick:n,variant:"contained",children:r})]})})},hk=e=>{let{title:t,message:n,onClearFilters:r,clearButtonText:o="Clear Filters"}=e;return(0,H.jsxs)(Jt,{sx:{textAlign:"center",py:8},children:[(0,H.jsx)(Pn,{variant:"h5",sx:{color:"rgba(255, 255, 255, 0.9)",mb:2,fontWeight:600},children:t}),(0,H.jsx)(Pn,{variant:"body1",sx:{color:"rgba(255, 255, 255, 0.7)",mb:3},children:n}),r&&(0,H.jsx)(_s,{variant:"outlined",onClick:r,sx:{color:"white",borderColor:"rgba(255, 255, 255, 0.3)","&:hover":{borderColor:"rgba(255, 255, 255, 0.5)",background:"rgba(255, 255, 255, 0.1)"}},children:o})]})},mk=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"===typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!==typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e))},a=t=e(r,o,i);return i},fk=e=>e;const gk=t=>{const n=(e=>e?mk(e):mk)(t),r=t=>function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fk;const r=e.useSyncExternalStore(t.subscribe,e.useCallback(()=>n(t.getState()),[t,n]),e.useCallback(()=>n(t.getInitialState()),[t,n]));return e.useDebugValue(r),r}(n,t);return Object.assign(r,n),r},yk=e=>e?gk(e):gk,xk=new Map,vk=e=>{const t=xk.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(e=>{let[t,n]=e;return[t,n.getState()]})):{}},bk=e=>{var t,n;if(!e)return;const r=e.split("\n"),o=r.findIndex(e=>e.includes("api.setState"));if(o<0)return;const i=(null==(t=r[o+1])?void 0:t.trim())||"";return null==(n=/.+ (.+) .+/.exec(i))?void 0:n[1]},wk=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(n,r,o)=>{const{enabled:i,anonymousActionType:a,store:s,...l}=t;let c;try{c=(null==i||i)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch(f){}if(!c)return e(n,r,o);const{connection:d,...u}=((e,t,n)=>{if(void 0===e)return{type:"untracked",connection:t.connect(n)};const r=xk.get(n.name);if(r)return{type:"tracked",store:e,...r};const o={connection:t.connect(n),stores:{}};return xk.set(n.name,o),{type:"tracked",store:e,...o}})(s,c,l);let p=!0;o.setState=(e,t,i)=>{const c=n(e,t);if(!p)return c;const u=void 0===i?{type:a||bk((new Error).stack)||"anonymous"}:"string"===typeof i?{type:i}:i;return void 0===s?(null==d||d.send(u,r()),c):(null==d||d.send({...u,type:`${s}/${u.type}`},{...vk(l.name),[s]:o.getState()}),c)},o.devtools={cleanup:()=>{d&&"function"===typeof d.unsubscribe&&d.unsubscribe(),((e,t)=>{if(void 0===t)return;const n=xk.get(e);n&&(delete n.stores[t],0===Object.keys(n.stores).length&&xk.delete(e))})(l.name,s)}};const h=function(){const e=p;p=!1,n(...arguments),p=e},m=e(o.setState,r,o);if("untracked"===u.type?null==d||d.init(m):(u.stores[u.store]=o,null==d||d.init(Object.fromEntries(Object.entries(u.stores).map(e=>{let[t,n]=e;return[t,t===u.store?m:n.getState()]})))),o.dispatchFromDevtools&&"function"===typeof o.dispatch){let e=!1;const t=o.dispatch;o.dispatch=function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];"__setState"!==r[0].type||e||(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),e=!0),t(...r)}}return d.subscribe(e=>{var t;switch(e.type){case"ACTION":return"string"!==typeof e.payload?void console.error("[zustand devtools middleware] Unsupported action format"):jk(e.payload,e=>{if("__setState"===e.type){if(void 0===s)return void h(e.state);1!==Object.keys(e.state).length&&console.error('\n [zustand devtools middleware] Unsupported __setState action format.\n When using \'store\' option in devtools(), the \'state\' should h
Line truncated
|
||||
//# sourceMappingURL=main.28afa9ad.js.map
|
||||
File renamed without changes.
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"static/js/main.cb1b37a5.js","mappings":"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 truncated
|
||||
{"version":3,"file":"static/js/main.28afa9ad.js","mappings":"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 truncated
|
||||
+705
@@ -0,0 +1,705 @@
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import {
|
||||
Box,
|
||||
Paper,
|
||||
Typography,
|
||||
Button,
|
||||
LinearProgress,
|
||||
Alert,
|
||||
Chip,
|
||||
IconButton,
|
||||
Tooltip as MuiTooltip,
|
||||
Card,
|
||||
CardContent,
|
||||
Grid,
|
||||
Divider,
|
||||
CircularProgress,
|
||||
Badge,
|
||||
Collapse,
|
||||
Accordion,
|
||||
AccordionSummary,
|
||||
AccordionDetails,
|
||||
List,
|
||||
ListItem,
|
||||
ListItemIcon,
|
||||
ListItemText,
|
||||
Dialog,
|
||||
DialogTitle,
|
||||
DialogContent,
|
||||
DialogActions
|
||||
} from '@mui/material';
|
||||
import {
|
||||
Business as BusinessIcon,
|
||||
People as PeopleIcon,
|
||||
TrendingUp as TrendingUpIcon,
|
||||
ContentPaste as ContentIcon,
|
||||
Analytics as AnalyticsIcon,
|
||||
Help as HelpIcon,
|
||||
CheckCircle as CheckCircleIcon,
|
||||
Warning as WarningIcon,
|
||||
AutoAwesome as AutoAwesomeIcon,
|
||||
Refresh as RefreshIcon,
|
||||
Save as SaveIcon,
|
||||
ArrowForward as ArrowForwardIcon,
|
||||
ArrowBack as ArrowBackIcon,
|
||||
Assessment as AssessmentIcon,
|
||||
ExpandMore as ExpandMoreIcon,
|
||||
Info as InfoIcon,
|
||||
Visibility as VisibilityIcon,
|
||||
School as SchoolIcon,
|
||||
Lightbulb as LightbulbIcon,
|
||||
Psychology as PsychologyIcon,
|
||||
Timeline as TimelineIcon
|
||||
} from '@mui/icons-material';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import { useEnhancedStrategyStore, STRATEGIC_INPUT_FIELDS } from '../../../stores/enhancedStrategyStore';
|
||||
import StrategicInputField from './ContentStrategyBuilder/StrategicInputField';
|
||||
import EnhancedTooltip from './ContentStrategyBuilder/EnhancedTooltip';
|
||||
import AIRecommendationsPanel from './AIRecommendationsPanel';
|
||||
import DataSourceTransparency from './DataSourceTransparency';
|
||||
|
||||
// Import extracted hooks
|
||||
import { useCategoryReview } from './ContentStrategyBuilder/hooks/useCategoryReview';
|
||||
import { useProgressTracking } from './ContentStrategyBuilder/hooks/useProgressTracking';
|
||||
import { useAutoPopulation } from './ContentStrategyBuilder/hooks/useAutoPopulation';
|
||||
|
||||
// Import extracted utilities
|
||||
import { getCategoryIcon, getCategoryColor, getCategoryName, getCategoryStatus } from './ContentStrategyBuilder/utils/categoryHelpers';
|
||||
import { getEducationalContent } from './ContentStrategyBuilder/utils/educationalContent';
|
||||
|
||||
// Import extracted components
|
||||
import CategoryList from './ContentStrategyBuilder/components/CategoryList';
|
||||
import ProgressTracker from './ContentStrategyBuilder/components/ProgressTracker';
|
||||
import HeaderSection from './ContentStrategyBuilder/components/HeaderSection';
|
||||
|
||||
const ContentStrategyBuilder: React.FC = () => {
|
||||
const {
|
||||
formData,
|
||||
formErrors,
|
||||
autoPopulatedFields,
|
||||
dataSources,
|
||||
loading,
|
||||
error,
|
||||
saving,
|
||||
aiGenerating,
|
||||
currentStep,
|
||||
completedSteps,
|
||||
disclosureSteps,
|
||||
currentStrategy,
|
||||
updateFormField,
|
||||
validateFormField,
|
||||
validateAllFields,
|
||||
completeStep,
|
||||
getNextStep,
|
||||
getPreviousStep,
|
||||
setCurrentStep,
|
||||
canProceedToStep,
|
||||
resetForm,
|
||||
autoPopulateFromOnboarding,
|
||||
generateAIRecommendations,
|
||||
createEnhancedStrategy,
|
||||
calculateCompletionPercentage,
|
||||
getCompletionStats,
|
||||
setError,
|
||||
setCurrentStrategy,
|
||||
setAIGenerating,
|
||||
setSaving
|
||||
} = useEnhancedStrategyStore();
|
||||
|
||||
const [showTooltip, setShowTooltip] = useState<string | null>(null);
|
||||
const [activeCategory, setActiveCategory] = useState<string | null>(null);
|
||||
const [showEducationalInfo, setShowEducationalInfo] = useState<string | null>(null);
|
||||
const [showAIRecommendations, setShowAIRecommendations] = useState(false);
|
||||
const [showDataSourceTransparency, setShowDataSourceTransparency] = useState(false);
|
||||
|
||||
// Ref to track if we've already set the default category
|
||||
const hasSetDefaultCategory = useRef(false);
|
||||
|
||||
const completionStats = getCompletionStats();
|
||||
const completionPercentage = calculateCompletionPercentage();
|
||||
|
||||
// Use extracted hooks
|
||||
const {
|
||||
reviewedCategories,
|
||||
isMarkingReviewed,
|
||||
categoryCompletionMessage,
|
||||
handleConfirmCategoryReview,
|
||||
isCategoryReviewed,
|
||||
getNextUnreviewedCategory,
|
||||
setReviewedCategories
|
||||
} = useCategoryReview({ completionStats, setError, setActiveCategory });
|
||||
|
||||
const {
|
||||
totalCategories,
|
||||
reviewedCategoriesCount,
|
||||
reviewProgressPercentage,
|
||||
getCategoryProgress,
|
||||
getCategoryStatus: getCategoryStatusFromHook,
|
||||
isNextInSequence
|
||||
} = useProgressTracking({ completionStats, reviewedCategories });
|
||||
|
||||
const { autoPopulateAttempted, setAutoPopulateAttempted } = useAutoPopulation({
|
||||
autoPopulateFromOnboarding,
|
||||
completionStats
|
||||
});
|
||||
|
||||
// Auto-populate from onboarding on first load
|
||||
useEffect(() => {
|
||||
if (!autoPopulateAttempted) {
|
||||
autoPopulateFromOnboarding();
|
||||
}
|
||||
}, [autoPopulateAttempted, autoPopulateFromOnboarding]);
|
||||
|
||||
// Set default category selection
|
||||
useEffect(() => {
|
||||
// Only set default category once when component mounts and we have categories
|
||||
if (hasSetDefaultCategory.current) {
|
||||
console.log('🔍 Default category useEffect: SKIPPED - already set default');
|
||||
return;
|
||||
}
|
||||
|
||||
if (Object.keys(completionStats.category_completion).length > 0) {
|
||||
const firstCategory = Object.keys(completionStats.category_completion)[0];
|
||||
console.log('🎯 Setting default category:', firstCategory);
|
||||
setActiveCategory(firstCategory);
|
||||
hasSetDefaultCategory.current = true;
|
||||
console.log('✅ hasSetDefaultCategory set to true');
|
||||
}
|
||||
}, [completionStats.category_completion]); // Removed activeCategory dependency
|
||||
|
||||
// Debug activeCategory changes
|
||||
useEffect(() => {
|
||||
console.log('🔄 activeCategory changed to:', activeCategory);
|
||||
console.trace('📍 Stack trace for activeCategory change');
|
||||
}, [activeCategory]);
|
||||
|
||||
// Add CSS keyframes for pulse animation
|
||||
useEffect(() => {
|
||||
const style = document.createElement('style');
|
||||
style.textContent = `
|
||||
@keyframes pulse {
|
||||
0% { transform: scale(1); }
|
||||
50% { transform: scale(1.1); }
|
||||
100% { transform: scale(1); }
|
||||
}
|
||||
@keyframes shimmer {
|
||||
0% { transform: translateX(-100%); }
|
||||
100% { transform: translateX(100%); }
|
||||
}
|
||||
@keyframes rotate {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
`;
|
||||
document.head.appendChild(style);
|
||||
return () => {
|
||||
if (document.head.contains(style)) {
|
||||
document.head.removeChild(style);
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
const handleCreateStrategy = async () => {
|
||||
try {
|
||||
setAIGenerating(true);
|
||||
setError(null);
|
||||
|
||||
console.log('Starting strategy creation...');
|
||||
console.log('Current formData:', formData);
|
||||
console.log('FormData ID:', formData.id);
|
||||
|
||||
// If we have a saved strategy, use its ID
|
||||
if (formData.id) {
|
||||
console.log('Using existing strategy ID:', formData.id);
|
||||
await generateAIRecommendations(formData.id);
|
||||
} else {
|
||||
console.log('No strategy ID found, creating new strategy...');
|
||||
// If no strategy is saved yet, save it first, then generate AI insights
|
||||
const isValid = validateAllFields();
|
||||
console.log('Form validation result:', isValid);
|
||||
|
||||
if (isValid) {
|
||||
const completionStats = getCompletionStats();
|
||||
const strategyData = {
|
||||
...formData,
|
||||
completion_percentage: completionStats.completion_percentage,
|
||||
user_id: 1, // This would come from auth context
|
||||
name: formData.name || 'Enhanced Content Strategy',
|
||||
industry: formData.industry || 'General'
|
||||
};
|
||||
|
||||
console.log('Attempting to create strategy with data:', strategyData);
|
||||
const newStrategy = await createEnhancedStrategy(strategyData);
|
||||
console.log('New strategy created:', newStrategy);
|
||||
|
||||
if (newStrategy && newStrategy.id) {
|
||||
console.log('Generating AI recommendations for new strategy ID:', newStrategy.id);
|
||||
await generateAIRecommendations(newStrategy.id);
|
||||
|
||||
// Set the current strategy and show success message
|
||||
setCurrentStrategy(newStrategy);
|
||||
setError(null); // Clear any previous errors
|
||||
|
||||
// Show success message
|
||||
setTimeout(() => {
|
||||
setError('Strategy created successfully! Check the Strategic Intelligence tab for detailed insights.');
|
||||
}, 100);
|
||||
|
||||
// Auto-switch to Strategic Intelligence tab after creation
|
||||
// This would need to be handled by the parent component
|
||||
} else {
|
||||
setError('Failed to create strategy or get strategy ID for AI generation.');
|
||||
console.error('Failed to create strategy or get strategy ID for AI generation.');
|
||||
}
|
||||
} else {
|
||||
setError('Please fill in all required fields before generating AI insights.');
|
||||
console.error('Form validation failed. Cannot generate AI insights.');
|
||||
}
|
||||
}
|
||||
} catch (err: any) {
|
||||
setError(`Error generating AI recommendations: ${err.message || 'Unknown error'}`);
|
||||
console.error('Error in handleCreateStrategy:', err);
|
||||
} finally {
|
||||
setAIGenerating(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleSaveStrategy = async () => {
|
||||
try {
|
||||
setSaving(true);
|
||||
setError(null);
|
||||
|
||||
const completionStats = getCompletionStats();
|
||||
const strategyData = {
|
||||
...formData,
|
||||
completion_percentage: completionStats.completion_percentage,
|
||||
user_id: 1,
|
||||
name: formData.name || 'Enhanced Content Strategy',
|
||||
industry: formData.industry || 'General'
|
||||
};
|
||||
|
||||
const newStrategy = await createEnhancedStrategy(strategyData);
|
||||
setCurrentStrategy(newStrategy);
|
||||
setError('Strategy saved successfully!');
|
||||
} catch (err: any) {
|
||||
setError(`Error saving strategy: ${err.message || 'Unknown error'}`);
|
||||
} finally {
|
||||
setSaving(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleReviewCategory = (categoryId: string) => {
|
||||
setActiveCategory(activeCategory === categoryId ? null : categoryId);
|
||||
};
|
||||
|
||||
const handleShowEducationalInfo = (categoryId: string) => {
|
||||
setShowEducationalInfo(showEducationalInfo === categoryId ? null : categoryId);
|
||||
};
|
||||
|
||||
// Wrapper for the hook function to maintain the same interface
|
||||
const handleConfirmCategoryReviewWrapper = () => {
|
||||
console.log('🔧 Wrapper called with activeCategory:', activeCategory);
|
||||
handleConfirmCategoryReview(activeCategory);
|
||||
};
|
||||
|
||||
return (
|
||||
<Box sx={{ p: 3 }}>
|
||||
{/* Header with Title (Region B) - Enhanced with Futuristic Styling */}
|
||||
<HeaderSection autoPopulatedFields={autoPopulatedFields} />
|
||||
|
||||
{/* Error Alert */}
|
||||
{error && (
|
||||
<Alert severity="error" sx={{ mb: 3 }}>
|
||||
{error}
|
||||
</Alert>
|
||||
)}
|
||||
|
||||
{/* Success Alert */}
|
||||
{!error && currentStrategy && (
|
||||
<Alert severity="success" sx={{ mb: 3 }}>
|
||||
Strategy "{currentStrategy.name}" created successfully! Check the Strategic Intelligence tab for detailed insights.
|
||||
</Alert>
|
||||
)}
|
||||
|
||||
{/* Strategy Display */}
|
||||
{currentStrategy && (
|
||||
<Paper sx={{ p: 3, mb: 3 }}>
|
||||
<Typography variant="h5" gutterBottom>
|
||||
Created Strategy: {currentStrategy.name}
|
||||
</Typography>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={12} md={6}>
|
||||
<Typography variant="subtitle1" color="text.secondary">
|
||||
Industry: {currentStrategy.industry}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1" color="text.secondary">
|
||||
Completion: {currentStrategy.completion_percentage}%
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={6}>
|
||||
<Typography variant="subtitle1" color="text.secondary">
|
||||
Created: {new Date(currentStrategy.created_at).toLocaleDateString()}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1" color="text.secondary">
|
||||
ID: {currentStrategy.id}
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Box sx={{ mt: 2 }}>
|
||||
<Button
|
||||
variant="outlined"
|
||||
onClick={() => window.location.href = '/content-planning?tab=strategic-intelligence'}
|
||||
startIcon={<AssessmentIcon />}
|
||||
>
|
||||
View Strategic Intelligence
|
||||
</Button>
|
||||
</Box>
|
||||
</Paper>
|
||||
)}
|
||||
|
||||
{categoryCompletionMessage && (
|
||||
<Alert
|
||||
severity="success"
|
||||
sx={{ mb: 3, display: 'flex', alignItems: 'center', justifyContent: 'center' }}
|
||||
>
|
||||
{categoryCompletionMessage}
|
||||
</Alert>
|
||||
)}
|
||||
|
||||
<Grid container spacing={3}>
|
||||
{/* Category Overview Panel */}
|
||||
<Grid item xs={12} md={4}>
|
||||
<Paper sx={{ p: 3, height: 'fit-content', position: 'sticky', top: 20 }}>
|
||||
{/* Enhanced Completion Tracker - Integrated into Category List */}
|
||||
<ProgressTracker
|
||||
reviewProgressPercentage={reviewProgressPercentage}
|
||||
reviewedCategoriesCount={reviewedCategoriesCount}
|
||||
totalCategories={totalCategories}
|
||||
autoPopulatedFields={autoPopulatedFields}
|
||||
aiGenerating={aiGenerating}
|
||||
onShowAIRecommendations={() => setShowAIRecommendations(true)}
|
||||
onShowDataSourceTransparency={() => setShowDataSourceTransparency(true)}
|
||||
onRefreshData={autoPopulateFromOnboarding}
|
||||
/>
|
||||
|
||||
{/* Category Progress - Compact with Futuristic Styling */}
|
||||
<Typography variant="h6" gutterBottom sx={{ mb: 1.5, fontSize: '1rem' }}>
|
||||
Category Progress
|
||||
</Typography>
|
||||
|
||||
<CategoryList
|
||||
completionStats={completionStats}
|
||||
formData={formData}
|
||||
STRATEGIC_INPUT_FIELDS={STRATEGIC_INPUT_FIELDS}
|
||||
activeCategory={activeCategory}
|
||||
reviewedCategories={reviewedCategories}
|
||||
isMarkingReviewed={isMarkingReviewed}
|
||||
isNextInSequence={isNextInSequence}
|
||||
onReviewCategory={handleReviewCategory}
|
||||
onShowEducationalInfo={handleShowEducationalInfo}
|
||||
/>
|
||||
|
||||
{/* Quick Actions */}
|
||||
<Box sx={{ mt: 3, pt: 2, borderTop: 1, borderColor: 'divider' }}>
|
||||
<Typography variant="subtitle2" gutterBottom>
|
||||
Quick Actions
|
||||
</Typography>
|
||||
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 1 }}>
|
||||
<Button
|
||||
size="small"
|
||||
variant="outlined"
|
||||
startIcon={<AutoAwesomeIcon />}
|
||||
onClick={() => setShowAIRecommendations(true)}
|
||||
fullWidth
|
||||
>
|
||||
View AI Insights
|
||||
</Button>
|
||||
<Button
|
||||
size="small"
|
||||
variant="outlined"
|
||||
startIcon={<InfoIcon />}
|
||||
onClick={() => setShowDataSourceTransparency(true)}
|
||||
fullWidth
|
||||
>
|
||||
View Data Sources
|
||||
</Button>
|
||||
<Button
|
||||
size="small"
|
||||
variant="outlined"
|
||||
startIcon={<RefreshIcon />}
|
||||
onClick={autoPopulateFromOnboarding}
|
||||
fullWidth
|
||||
>
|
||||
Refresh Data
|
||||
</Button>
|
||||
</Box>
|
||||
</Box>
|
||||
</Paper>
|
||||
</Grid>
|
||||
|
||||
{/* Main Content Area */}
|
||||
<Grid item xs={12} md={8}>
|
||||
<Paper sx={{ p: 3, minHeight: '600px' }}>
|
||||
{activeCategory ? (
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: 20 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ duration: 0.3 }}
|
||||
>
|
||||
{/* Category Header */}
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', mb: 3 }}>
|
||||
{getCategoryIcon(activeCategory)}
|
||||
<Typography variant="h5" sx={{ ml: 1 }}>
|
||||
{activeCategory.split('_').map(word =>
|
||||
word.charAt(0).toUpperCase() + word.slice(1)
|
||||
).join(' ')}
|
||||
</Typography>
|
||||
<Chip
|
||||
label={`${Math.round(completionStats.category_completion[activeCategory])}% Complete`}
|
||||
color={getCategoryColor(activeCategory) as any}
|
||||
sx={{ ml: 'auto' }}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
{/* Educational Info Dialog */}
|
||||
<Dialog
|
||||
open={!!showEducationalInfo}
|
||||
onClose={() => setShowEducationalInfo(null)}
|
||||
maxWidth="md"
|
||||
fullWidth
|
||||
>
|
||||
<DialogTitle>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
<SchoolIcon />
|
||||
{showEducationalInfo && getEducationalContent(showEducationalInfo).title}
|
||||
</Box>
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<Typography variant="body1" paragraph>
|
||||
{showEducationalInfo && getEducationalContent(showEducationalInfo).description}
|
||||
</Typography>
|
||||
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Key Points:
|
||||
</Typography>
|
||||
<List>
|
||||
{showEducationalInfo && getEducationalContent(showEducationalInfo).points.map((point, index) => (
|
||||
<ListItem key={index} sx={{ py: 0.5 }}>
|
||||
<ListItemIcon>
|
||||
<LightbulbIcon color="primary" fontSize="small" />
|
||||
</ListItemIcon>
|
||||
<ListItemText primary={point} />
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Pro Tips:
|
||||
</Typography>
|
||||
<List>
|
||||
{showEducationalInfo && getEducationalContent(showEducationalInfo).tips.map((tip, index) => (
|
||||
<ListItem key={index} sx={{ py: 0.5 }}>
|
||||
<ListItemIcon>
|
||||
<PsychologyIcon color="secondary" fontSize="small" />
|
||||
</ListItemIcon>
|
||||
<ListItemText primary={tip} />
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={() => setShowEducationalInfo(null)}>
|
||||
Got it!
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
|
||||
{/* Category Fields */}
|
||||
<Grid container spacing={1.5}>
|
||||
{STRATEGIC_INPUT_FIELDS
|
||||
.filter(field => field.category === activeCategory)
|
||||
.map((field) => {
|
||||
// Group number-based fields together
|
||||
const isNumberField = field.type === 'number' ||
|
||||
field.id.includes('budget') ||
|
||||
field.id.includes('size') ||
|
||||
field.id.includes('timeline') ||
|
||||
field.id.includes('metrics');
|
||||
|
||||
// Determine grid size based on field type
|
||||
const gridSize = isNumberField ? 6 : 12;
|
||||
|
||||
return (
|
||||
<Grid item xs={12} md={gridSize} key={field.id}>
|
||||
<StrategicInputField
|
||||
fieldId={field.id}
|
||||
value={formData[field.id]}
|
||||
error={formErrors[field.id]}
|
||||
autoPopulated={!!autoPopulatedFields[field.id]}
|
||||
dataSource={dataSources[field.id]}
|
||||
confidenceLevel={autoPopulatedFields[field.id] ? 0.8 : undefined}
|
||||
dataQuality={autoPopulatedFields[field.id] ? 'High Quality' : undefined}
|
||||
onChange={(value: any) => updateFormField(field.id, value)}
|
||||
onValidate={() => validateFormField(field.id)}
|
||||
onShowTooltip={() => setShowTooltip(field.id)}
|
||||
/>
|
||||
</Grid>
|
||||
);
|
||||
})}
|
||||
</Grid>
|
||||
|
||||
{/* Category Actions */}
|
||||
<Box sx={{ mt: 3, display: 'flex', gap: 2 }}>
|
||||
{(() => {
|
||||
const isReviewed = reviewedCategories.has(activeCategory);
|
||||
console.log('🔍 Category review status:', {
|
||||
activeCategory,
|
||||
isReviewed,
|
||||
reviewedCategories: Array.from(reviewedCategories)
|
||||
});
|
||||
return !isReviewed ? (
|
||||
<Button
|
||||
variant="contained"
|
||||
onClick={() => {
|
||||
console.log('🔘 Button clicked! activeCategory:', activeCategory);
|
||||
console.log('🔘 reviewedCategories:', Array.from(reviewedCategories));
|
||||
console.log('🔘 isMarkingReviewed:', isMarkingReviewed);
|
||||
handleConfirmCategoryReviewWrapper();
|
||||
}}
|
||||
startIcon={isMarkingReviewed ? <CircularProgress size={20} /> : <CheckCircleIcon />}
|
||||
disabled={isMarkingReviewed}
|
||||
>
|
||||
{isMarkingReviewed ? 'Marking as Reviewed...' : 'Mark as Reviewed'}
|
||||
</Button>
|
||||
) : (
|
||||
<Chip
|
||||
label="Category Reviewed"
|
||||
color="success"
|
||||
icon={<CheckCircleIcon />}
|
||||
sx={{ px: 2, py: 1 }}
|
||||
/>
|
||||
);
|
||||
})()}
|
||||
|
||||
<Button
|
||||
variant="outlined"
|
||||
onClick={() => setActiveCategory(null)}
|
||||
>
|
||||
Back to Overview
|
||||
</Button>
|
||||
</Box>
|
||||
</motion.div>
|
||||
) : (
|
||||
<motion.div
|
||||
initial={{ opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
transition={{ duration: 0.3 }}
|
||||
>
|
||||
<Box sx={{ textAlign: 'center', py: 8 }}>
|
||||
<TimelineIcon sx={{ fontSize: 64, color: 'text.secondary', mb: 2 }} />
|
||||
<Typography variant="h5" gutterBottom>
|
||||
Select a Category to Review
|
||||
</Typography>
|
||||
<Typography variant="body1" color="text.secondary">
|
||||
Click on any category from the left panel to review and complete the fields.
|
||||
</Typography>
|
||||
</Box>
|
||||
</motion.div>
|
||||
)}
|
||||
</Paper>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
{/* Action Buttons */}
|
||||
<Box sx={{ mt: 3, display: 'flex', gap: 2, justifyContent: 'flex-end' }}>
|
||||
<MuiTooltip
|
||||
title={reviewProgressPercentage < 20 ? `Complete at least 20% of the form (currently ${Math.round(reviewProgressPercentage)}%)` : 'Create a comprehensive content strategy with AI insights'}
|
||||
placement="top"
|
||||
>
|
||||
<span>
|
||||
<Button
|
||||
variant="outlined"
|
||||
startIcon={<AutoAwesomeIcon />}
|
||||
onClick={handleCreateStrategy}
|
||||
disabled={aiGenerating || reviewProgressPercentage < 20}
|
||||
>
|
||||
{aiGenerating ? 'Creating...' : 'Create Strategy'}
|
||||
</Button>
|
||||
</span>
|
||||
</MuiTooltip>
|
||||
|
||||
<Button
|
||||
variant="contained"
|
||||
startIcon={<SaveIcon />}
|
||||
onClick={handleSaveStrategy}
|
||||
disabled={saving || reviewProgressPercentage < 30}
|
||||
>
|
||||
{saving ? 'Saving...' : 'Save Strategy'}
|
||||
</Button>
|
||||
</Box>
|
||||
|
||||
{/* AI Recommendations Modal */}
|
||||
<Dialog
|
||||
open={showAIRecommendations}
|
||||
onClose={() => setShowAIRecommendations(false)}
|
||||
maxWidth="md"
|
||||
fullWidth
|
||||
>
|
||||
<DialogTitle>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
<AutoAwesomeIcon />
|
||||
AI Recommendations & Insights
|
||||
</Box>
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<AIRecommendationsPanel
|
||||
aiGenerating={aiGenerating}
|
||||
onGenerateRecommendations={handleCreateStrategy}
|
||||
/>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={() => setShowAIRecommendations(false)}>
|
||||
Close
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
|
||||
{/* Data Source Transparency Modal */}
|
||||
<Dialog
|
||||
open={showDataSourceTransparency}
|
||||
onClose={() => setShowDataSourceTransparency(false)}
|
||||
maxWidth="md"
|
||||
fullWidth
|
||||
>
|
||||
<DialogTitle>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
<InfoIcon />
|
||||
Data Source Transparency
|
||||
</Box>
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<DataSourceTransparency
|
||||
autoPopulatedFields={autoPopulatedFields}
|
||||
dataSources={dataSources}
|
||||
/>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={() => setShowDataSourceTransparency(false)}>
|
||||
Close
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
|
||||
{/* Tooltip */}
|
||||
{showTooltip && (
|
||||
<EnhancedTooltip
|
||||
fieldId={showTooltip}
|
||||
open={!!showTooltip}
|
||||
onClose={() => setShowTooltip(null)}
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export default ContentStrategyBuilder;
|
||||
+1
-1
@@ -27,7 +27,7 @@ import {
|
||||
DataUsage as DataUsageIcon,
|
||||
Close as CloseIcon
|
||||
} from '@mui/icons-material';
|
||||
import { useEnhancedStrategyStore } from '../../../stores/enhancedStrategyStore';
|
||||
import { useEnhancedStrategyStore } from '../../../../stores/enhancedStrategyStore';
|
||||
|
||||
interface EnhancedTooltipProps {
|
||||
fieldId: string;
|
||||
+127
-37
@@ -21,9 +21,10 @@ import {
|
||||
AutoAwesome as AutoAwesomeIcon,
|
||||
Warning as WarningIcon,
|
||||
CheckCircle as CheckCircleIcon,
|
||||
Edit as EditIcon
|
||||
Edit as EditIcon,
|
||||
Info as InfoIcon
|
||||
} from '@mui/icons-material';
|
||||
import { useEnhancedStrategyStore } from '../../../stores/enhancedStrategyStore';
|
||||
import { useEnhancedStrategyStore } from '../../../../stores/enhancedStrategyStore';
|
||||
|
||||
interface StrategicInputFieldProps {
|
||||
fieldId: string;
|
||||
@@ -31,6 +32,8 @@ interface StrategicInputFieldProps {
|
||||
error?: string;
|
||||
autoPopulated?: boolean;
|
||||
dataSource?: string;
|
||||
confidenceLevel?: number;
|
||||
dataQuality?: string;
|
||||
onChange: (value: any) => void;
|
||||
onValidate: () => boolean;
|
||||
onShowTooltip: () => void;
|
||||
@@ -71,6 +74,8 @@ const StrategicInputField: React.FC<StrategicInputFieldProps> = ({
|
||||
error,
|
||||
autoPopulated = false,
|
||||
dataSource,
|
||||
confidenceLevel,
|
||||
dataQuality,
|
||||
onChange,
|
||||
onValidate,
|
||||
onShowTooltip
|
||||
@@ -198,10 +203,10 @@ const StrategicInputField: React.FC<StrategicInputFieldProps> = ({
|
||||
required: false
|
||||
},
|
||||
preferred_formats: {
|
||||
type: 'json',
|
||||
type: 'multiselect',
|
||||
label: 'Preferred Formats',
|
||||
placeholder: 'Define preferred content formats',
|
||||
required: false
|
||||
options: ['Blog Posts', 'Videos', 'Infographics', 'Webinars', 'Podcasts', 'Case Studies', 'Whitepapers', 'Social Media Posts'],
|
||||
required: true
|
||||
},
|
||||
content_mix: {
|
||||
type: 'json',
|
||||
@@ -477,44 +482,129 @@ const StrategicInputField: React.FC<StrategicInputFieldProps> = ({
|
||||
};
|
||||
|
||||
return (
|
||||
<Box sx={{ position: 'relative' }}>
|
||||
{/* Auto-population indicator */}
|
||||
{autoPopulated && (
|
||||
<Box sx={{ mb: 1, display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
<Chip
|
||||
icon={<AutoAwesomeIcon />}
|
||||
label={`Auto-populated from ${dataSource}`}
|
||||
color="info"
|
||||
size="small"
|
||||
variant="outlined"
|
||||
/>
|
||||
{!isEditing && (
|
||||
<Tooltip title="Edit auto-populated value">
|
||||
<IconButton size="small" onClick={() => setIsEditing(true)}>
|
||||
<EditIcon fontSize="small" />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Box sx={{
|
||||
position: 'relative',
|
||||
mb: 1.5,
|
||||
p: 1.5,
|
||||
borderRadius: 1.5,
|
||||
bgcolor: 'background.paper',
|
||||
border: '1px solid',
|
||||
borderColor: error ? 'error.main' : autoPopulated ? 'info.main' : 'divider',
|
||||
'&:hover': {
|
||||
borderColor: 'primary.main',
|
||||
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
||||
transition: 'all 0.2s ease'
|
||||
}
|
||||
}}>
|
||||
{/* Field input - Enhanced styling */}
|
||||
<Box sx={{
|
||||
'& .MuiTextField-root, & .MuiFormControl-root': {
|
||||
'& .MuiInputBase-root': {
|
||||
borderRadius: 1,
|
||||
'&:hover': {
|
||||
'& .MuiOutlinedInput-notchedOutline': {
|
||||
borderColor: 'primary.main'
|
||||
}
|
||||
}
|
||||
},
|
||||
'& .MuiInputLabel-root': {
|
||||
fontSize: '0.8rem',
|
||||
fontWeight: 500
|
||||
},
|
||||
'& .MuiInputBase-input': {
|
||||
fontSize: '0.85rem',
|
||||
padding: '8px 12px'
|
||||
}
|
||||
}
|
||||
}}>
|
||||
{renderInput()}
|
||||
</Box>
|
||||
|
||||
{/* Data Transparency and Auto-population Indicators */}
|
||||
<Box sx={{
|
||||
mt: 1,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
flexWrap: 'wrap',
|
||||
gap: 1
|
||||
}}>
|
||||
{/* Left side - Validation and Quality indicators */}
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
{/* Validation status */}
|
||||
{value && !error && (
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>
|
||||
<CheckCircleIcon color="success" sx={{ fontSize: 14 }} />
|
||||
<Typography variant="caption" color="success.main" sx={{ fontSize: '0.7rem' }}>
|
||||
Valid
|
||||
</Typography>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
{/* Data Quality indicator */}
|
||||
{dataQuality && (
|
||||
<Chip
|
||||
icon={<InfoIcon sx={{ fontSize: 12 }} />}
|
||||
label={dataQuality}
|
||||
size="small"
|
||||
variant="outlined"
|
||||
color="primary"
|
||||
sx={{
|
||||
fontSize: '0.6rem',
|
||||
height: 20,
|
||||
'& .MuiChip-label': { px: 1 }
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Confidence Level indicator */}
|
||||
{confidenceLevel && (
|
||||
<Chip
|
||||
label={`${Math.round(confidenceLevel * 100)}% confidence`}
|
||||
size="small"
|
||||
variant="outlined"
|
||||
color={confidenceLevel > 0.8 ? 'success' : confidenceLevel > 0.6 ? 'warning' : 'error'}
|
||||
sx={{
|
||||
fontSize: '0.6rem',
|
||||
height: 20,
|
||||
'& .MuiChip-label': { px: 1 }
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
)}
|
||||
|
||||
{/* Field input */}
|
||||
{renderInput()}
|
||||
|
||||
{/* Validation status */}
|
||||
{value && !error && (
|
||||
<Box sx={{ mt: 1, display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
<CheckCircleIcon color="success" fontSize="small" />
|
||||
<Typography variant="caption" color="success.main">
|
||||
Valid
|
||||
</Typography>
|
||||
</Box>
|
||||
)}
|
||||
{/* Right side - Auto-population indicator */}
|
||||
{autoPopulated && (
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>
|
||||
<Chip
|
||||
icon={<AutoAwesomeIcon sx={{ fontSize: 12 }} />}
|
||||
label={`Auto-populated from ${dataSource}`}
|
||||
color="info"
|
||||
size="small"
|
||||
variant="outlined"
|
||||
sx={{
|
||||
fontSize: '0.6rem',
|
||||
height: 20,
|
||||
'& .MuiChip-label': { px: 1 }
|
||||
}}
|
||||
/>
|
||||
{!isEditing && (
|
||||
<Tooltip title="Edit auto-populated value">
|
||||
<IconButton size="small" onClick={() => setIsEditing(true)} sx={{ width: 20, height: 20 }}>
|
||||
<EditIcon sx={{ fontSize: 12 }} />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
)}
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
|
||||
{/* Error display */}
|
||||
{error && (
|
||||
<Alert severity="error" sx={{ mt: 1 }}>
|
||||
<Typography variant="body2">{error}</Typography>
|
||||
<Alert severity="error" sx={{ mt: 1, py: 0.5, '& .MuiAlert-message': { py: 0 } }}>
|
||||
<Typography variant="caption" sx={{ fontSize: '0.7rem' }}>
|
||||
{error}
|
||||
</Typography>
|
||||
</Alert>
|
||||
)}
|
||||
</Box>
|
||||
+255
@@ -0,0 +1,255 @@
|
||||
import React from 'react';
|
||||
import {
|
||||
List,
|
||||
ListItem,
|
||||
ListItemIcon,
|
||||
ListItemText,
|
||||
Chip,
|
||||
Box,
|
||||
Typography,
|
||||
Button,
|
||||
IconButton,
|
||||
CircularProgress
|
||||
} from '@mui/material';
|
||||
import {
|
||||
CheckCircle as CheckCircleIcon,
|
||||
TrendingUp as TrendingUpIcon,
|
||||
Warning as WarningIcon,
|
||||
Visibility as VisibilityIcon,
|
||||
School as SchoolIcon
|
||||
} from '@mui/icons-material';
|
||||
import { motion } from 'framer-motion';
|
||||
import { getCategoryIcon, getCategoryName, getCategoryStatus } from '../utils/categoryHelpers';
|
||||
|
||||
interface CategoryListProps {
|
||||
completionStats: any;
|
||||
formData: any;
|
||||
STRATEGIC_INPUT_FIELDS: any[];
|
||||
activeCategory: string | null;
|
||||
reviewedCategories: Set<string>;
|
||||
isMarkingReviewed: boolean;
|
||||
isNextInSequence: (categoryId: string, allCategories: string[]) => boolean;
|
||||
onReviewCategory: (categoryId: string) => void;
|
||||
onShowEducationalInfo: (categoryId: string) => void;
|
||||
}
|
||||
|
||||
const CategoryList: React.FC<CategoryListProps> = ({
|
||||
completionStats,
|
||||
formData,
|
||||
STRATEGIC_INPUT_FIELDS,
|
||||
activeCategory,
|
||||
reviewedCategories,
|
||||
isMarkingReviewed,
|
||||
isNextInSequence,
|
||||
onReviewCategory,
|
||||
onShowEducationalInfo
|
||||
}) => {
|
||||
return (
|
||||
<List sx={{ p: 0 }}>
|
||||
{Object.entries(completionStats.category_completion).map(([categoryId, percentage]) => {
|
||||
const categoryName = getCategoryName(categoryId);
|
||||
const percentageValue = percentage as number;
|
||||
|
||||
// Get category-specific stats
|
||||
const categoryFields = STRATEGIC_INPUT_FIELDS.filter(f => f.category === categoryId);
|
||||
const filledFields = categoryFields.filter(field => formData[field.id]).length;
|
||||
const totalFields = categoryFields.length;
|
||||
|
||||
const categoryStatus = getCategoryStatus(percentageValue);
|
||||
const isSelected = activeCategory === categoryId;
|
||||
const isDefault = Object.keys(completionStats.category_completion)[0] === categoryId;
|
||||
const isReviewed = reviewedCategories.has(categoryId);
|
||||
|
||||
// Find the next category in sequence for guidance
|
||||
const allCategories = Object.keys(completionStats.category_completion);
|
||||
const isNextInSequenceCategory = isNextInSequence(categoryId, allCategories);
|
||||
|
||||
return (
|
||||
<motion.div
|
||||
key={categoryId}
|
||||
initial={{ opacity: 0, x: -20 }}
|
||||
animate={{ opacity: 1, x: 0 }}
|
||||
transition={{ duration: 0.3 }}
|
||||
>
|
||||
<ListItem
|
||||
sx={{
|
||||
p: 1.5, // 50% more compact padding
|
||||
mb: 0.5, // Reduced margin
|
||||
borderRadius: 2,
|
||||
bgcolor: isSelected ? 'action.hover' : isNextInSequenceCategory ? 'rgba(25, 118, 210, 0.08)' : 'transparent',
|
||||
border: isSelected ? '2px solid' : isNextInSequenceCategory ? '1px solid' : '1px solid',
|
||||
borderColor: isSelected ? 'primary.main' : isNextInSequenceCategory ? 'primary.main' : 'divider',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'stretch',
|
||||
position: 'relative',
|
||||
overflow: 'hidden',
|
||||
// Futuristic styling
|
||||
background: isSelected ? 'linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%)' : 'transparent',
|
||||
backdropFilter: isSelected ? 'blur(10px)' : 'none',
|
||||
// Shimmer animation for default category
|
||||
'&::before': isDefault && !isSelected ? {
|
||||
content: '""',
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
left: '-100%',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
background: 'linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent)',
|
||||
animation: 'shimmer 2s infinite',
|
||||
zIndex: 0
|
||||
} : {},
|
||||
'&:hover': {
|
||||
transform: 'translateY(-1px)',
|
||||
boxShadow: '0 4px 12px rgba(0,0,0,0.1)',
|
||||
transition: 'all 0.2s ease'
|
||||
}
|
||||
}}
|
||||
>
|
||||
{/* Category Header - Compact */}
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', width: '100%', mb: 0.5, position: 'relative', zIndex: 1 }}>
|
||||
<ListItemIcon sx={{ minWidth: 32 }}>
|
||||
{getCategoryIcon(categoryId)}
|
||||
</ListItemIcon>
|
||||
<ListItemText
|
||||
primary={
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
{categoryName}
|
||||
{isNextInSequenceCategory && (
|
||||
<Chip
|
||||
label="Next"
|
||||
size="small"
|
||||
color="primary"
|
||||
sx={{
|
||||
height: 16,
|
||||
fontSize: '0.6rem',
|
||||
'& .MuiChip-label': { px: 0.5 }
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
}
|
||||
secondary={`${Math.round(percentageValue)}% complete`}
|
||||
sx={{
|
||||
flex: 1,
|
||||
'& .MuiListItemText-primary': { fontSize: '0.9rem', fontWeight: 500 },
|
||||
'& .MuiListItemText-secondary': { fontSize: '0.7rem' }
|
||||
}}
|
||||
/>
|
||||
<Chip
|
||||
label={isReviewed ? 'Reviewed' : categoryStatus.status}
|
||||
color={isReviewed ? 'success' : categoryStatus.color}
|
||||
size="small"
|
||||
sx={{
|
||||
mr: 0.5,
|
||||
height: 20,
|
||||
fontSize: '0.6rem',
|
||||
'& .MuiChip-label': { px: 1 }
|
||||
}}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
{/* Category Progress Bar - Compact Circular */}
|
||||
<Box sx={{ mb: 0.5, position: 'relative', zIndex: 1, display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
<Box sx={{ position: 'relative', display: 'inline-flex' }}>
|
||||
<CircularProgress
|
||||
variant="determinate"
|
||||
value={percentageValue}
|
||||
size={24}
|
||||
thickness={3}
|
||||
sx={{
|
||||
color: 'primary.main',
|
||||
'& .MuiCircularProgress-circle': {
|
||||
strokeLinecap: 'round',
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<Box
|
||||
sx={{
|
||||
top: 0,
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
position: 'absolute',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
variant="caption"
|
||||
component="div"
|
||||
color="text.secondary"
|
||||
sx={{ fontSize: '0.5rem', fontWeight: 'bold' }}
|
||||
>
|
||||
{`${Math.round(percentageValue)}%`}
|
||||
</Typography>
|
||||
</Box>
|
||||
</Box>
|
||||
<Typography variant="caption" color="text.secondary" sx={{ fontSize: '0.6rem' }}>
|
||||
{filledFields}/{totalFields} fields
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
{/* Category Actions - Compact */}
|
||||
<Box sx={{ display: 'flex', gap: 0.5, justifyContent: 'space-between', alignItems: 'center', position: 'relative', zIndex: 1 }}>
|
||||
<Box sx={{ display: 'flex', gap: 0.5 }}>
|
||||
{/* Review Button - Compact */}
|
||||
<Button
|
||||
size="small"
|
||||
variant="outlined"
|
||||
startIcon={
|
||||
isMarkingReviewed && activeCategory === categoryId ?
|
||||
<CircularProgress size={14} /> :
|
||||
<VisibilityIcon sx={{ fontSize: 14 }} />
|
||||
}
|
||||
onClick={() => onReviewCategory(categoryId)}
|
||||
disabled={isMarkingReviewed && activeCategory === categoryId}
|
||||
sx={{
|
||||
minWidth: 'auto',
|
||||
height: 24,
|
||||
fontSize: '0.6rem',
|
||||
px: 1,
|
||||
'& .MuiButton-startIcon': { mr: 0.5 }
|
||||
}}
|
||||
>
|
||||
{isMarkingReviewed && activeCategory === categoryId ?
|
||||
'Marking...' :
|
||||
(isReviewed ? 'Reviewed' : 'Review')
|
||||
}
|
||||
</Button>
|
||||
|
||||
{/* Educational Info Button - Compact */}
|
||||
<IconButton
|
||||
size="small"
|
||||
onClick={() => onShowEducationalInfo(categoryId)}
|
||||
sx={{
|
||||
color: 'primary.main',
|
||||
width: 24,
|
||||
height: 24,
|
||||
'& .MuiSvgIcon-root': { fontSize: 14 }
|
||||
}}
|
||||
>
|
||||
<SchoolIcon />
|
||||
</IconButton>
|
||||
</Box>
|
||||
|
||||
{/* Category Status Indicator - Compact */}
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 0.25 }}>
|
||||
{percentageValue >= 90 ? (
|
||||
<CheckCircleIcon color="success" fontSize="small" sx={{ fontSize: 14 }} />
|
||||
) : percentageValue >= 70 ? (
|
||||
<TrendingUpIcon color="primary" fontSize="small" sx={{ fontSize: 14 }} />
|
||||
) : (
|
||||
<WarningIcon color="warning" fontSize="small" sx={{ fontSize: 14 }} />
|
||||
)}
|
||||
</Box>
|
||||
</Box>
|
||||
</ListItem>
|
||||
</motion.div>
|
||||
);
|
||||
})}
|
||||
</List>
|
||||
);
|
||||
};
|
||||
|
||||
export default CategoryList;
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
import React from 'react';
|
||||
import {
|
||||
Paper,
|
||||
Box,
|
||||
Typography
|
||||
} from '@mui/material';
|
||||
import {
|
||||
CheckCircle as CheckCircleIcon
|
||||
} from '@mui/icons-material';
|
||||
import { motion } from 'framer-motion';
|
||||
|
||||
interface HeaderSectionProps {
|
||||
autoPopulatedFields: any;
|
||||
}
|
||||
|
||||
const HeaderSection: React.FC<HeaderSectionProps> = ({ autoPopulatedFields }) => {
|
||||
return (
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: -20 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ duration: 0.5 }}
|
||||
>
|
||||
<Paper
|
||||
sx={{
|
||||
p: 2.5, // More compact padding
|
||||
mb: 3,
|
||||
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%)', // Enhanced gradient
|
||||
color: 'white',
|
||||
borderRadius: 3,
|
||||
position: 'relative',
|
||||
overflow: 'hidden',
|
||||
'&::before': {
|
||||
content: '""',
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
background: 'linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.1) 100%)',
|
||||
animation: 'shimmer 3s ease-in-out infinite',
|
||||
},
|
||||
boxShadow: '0 8px 32px rgba(102, 126, 234, 0.3), 0 0 0 1px rgba(255,255,255,0.1)',
|
||||
backdropFilter: 'blur(10px)',
|
||||
border: '1px solid rgba(255,255,255,0.2)',
|
||||
}}
|
||||
>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', position: 'relative', zIndex: 1 }}>
|
||||
<Box>
|
||||
<Typography
|
||||
variant="h4"
|
||||
gutterBottom
|
||||
sx={{
|
||||
fontWeight: 'bold',
|
||||
background: 'linear-gradient(45deg, #fff, #f0f0f0)',
|
||||
backgroundClip: 'text',
|
||||
WebkitBackgroundClip: 'text',
|
||||
WebkitTextFillColor: 'transparent',
|
||||
textShadow: '0 0 20px rgba(255,255,255,0.5)',
|
||||
mb: 1
|
||||
}}
|
||||
>
|
||||
AI Content Strategy Co-pilot
|
||||
</Typography>
|
||||
<Typography variant="body1" sx={{ opacity: 0.9, fontSize: '0.9rem' }}>
|
||||
Build a comprehensive content strategy with 30+ strategic inputs
|
||||
</Typography>
|
||||
|
||||
{/* Auto-population Status - Moved to header (Region 4) */}
|
||||
{autoPopulatedFields && Object.keys(autoPopulatedFields).length > 0 && (
|
||||
<Box sx={{ mt: 1.5, display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
<CheckCircleIcon sx={{ color: 'rgba(255,255,255,0.8)', fontSize: 18 }} />
|
||||
<Typography variant="body2" sx={{ color: 'rgba(255,255,255,0.9)', fontSize: '0.85rem' }}>
|
||||
{Object.keys(autoPopulatedFields).length} fields auto-populated from onboarding data
|
||||
</Typography>
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
</Box>
|
||||
</Paper>
|
||||
</motion.div>
|
||||
);
|
||||
};
|
||||
|
||||
export default HeaderSection;
|
||||
+217
@@ -0,0 +1,217 @@
|
||||
import React from 'react';
|
||||
import {
|
||||
Box,
|
||||
Typography,
|
||||
CircularProgress,
|
||||
IconButton,
|
||||
Badge,
|
||||
Tooltip as MuiTooltip
|
||||
} from '@mui/material';
|
||||
import {
|
||||
CheckCircle as CheckCircleIcon,
|
||||
AutoAwesome as AutoAwesomeIcon,
|
||||
Info as InfoIcon,
|
||||
Refresh as RefreshIcon
|
||||
} from '@mui/icons-material';
|
||||
import { motion } from 'framer-motion';
|
||||
|
||||
interface ProgressTrackerProps {
|
||||
reviewProgressPercentage: number;
|
||||
reviewedCategoriesCount: number;
|
||||
totalCategories: number;
|
||||
autoPopulatedFields: any;
|
||||
aiGenerating: boolean;
|
||||
onShowAIRecommendations: () => void;
|
||||
onShowDataSourceTransparency: () => void;
|
||||
onRefreshData: () => void;
|
||||
}
|
||||
|
||||
const ProgressTracker: React.FC<ProgressTrackerProps> = ({
|
||||
reviewProgressPercentage,
|
||||
reviewedCategoriesCount,
|
||||
totalCategories,
|
||||
autoPopulatedFields,
|
||||
aiGenerating,
|
||||
onShowAIRecommendations,
|
||||
onShowDataSourceTransparency,
|
||||
onRefreshData
|
||||
}) => {
|
||||
return (
|
||||
<Box sx={{ mb: 2 }}>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', mb: 1.5 }}>
|
||||
<Typography variant="h6" gutterBottom sx={{ mb: 0 }}>
|
||||
Progress
|
||||
</Typography>
|
||||
{/* Spiral Progress - Moved from Region 2 to Region 3 */}
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
<Box sx={{ position: 'relative', display: 'inline-flex' }}>
|
||||
<CircularProgress
|
||||
variant="determinate"
|
||||
value={reviewProgressPercentage}
|
||||
size={40}
|
||||
thickness={4}
|
||||
sx={{
|
||||
color: 'primary.main',
|
||||
'& .MuiCircularProgress-circle': {
|
||||
strokeLinecap: 'round',
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<Box
|
||||
sx={{
|
||||
top: 0,
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
position: 'absolute',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
variant="caption"
|
||||
component="div"
|
||||
color="text.secondary"
|
||||
sx={{ fontSize: '0.7rem', fontWeight: 'bold' }}
|
||||
>
|
||||
{`${Math.round(reviewProgressPercentage)}%`}
|
||||
</Typography>
|
||||
</Box>
|
||||
</Box>
|
||||
<Typography variant="caption" color="text.secondary" sx={{ fontSize: '0.7rem' }}>
|
||||
{reviewedCategoriesCount}/{totalCategories}
|
||||
</Typography>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
{/* Status Indicators - Compact */}
|
||||
<Box sx={{ mb: 1.5 }}>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5, mb: 0.5 }}>
|
||||
<CheckCircleIcon color="success" fontSize="small" sx={{ fontSize: 14 }} />
|
||||
<Typography variant="caption" color="text.secondary" sx={{ fontSize: '0.7rem' }}>
|
||||
Auto-population: {Object.keys(autoPopulatedFields || {}).length} fields
|
||||
</Typography>
|
||||
</Box>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>
|
||||
<AutoAwesomeIcon color="primary" fontSize="small" sx={{ fontSize: 14 }} />
|
||||
<Typography variant="caption" color="text.secondary" sx={{ fontSize: '0.7rem' }}>
|
||||
AI Insights: {aiGenerating ? 'Generating...' : 'Ready'}
|
||||
</Typography>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
{/* Icons moved from Region A to Region B - Now integrated into Progress title area */}
|
||||
<Box sx={{ display: 'flex', gap: 1, justifyContent: 'center', mt: 1.5 }}>
|
||||
{/* AI Recommendations Button - Compact */}
|
||||
<MuiTooltip title="View AI-powered recommendations and insights" placement="top">
|
||||
<motion.div
|
||||
whileHover={{ scale: 1.05 }}
|
||||
whileTap={{ scale: 0.95 }}
|
||||
>
|
||||
<IconButton
|
||||
onClick={onShowAIRecommendations}
|
||||
sx={{
|
||||
color: 'primary.main',
|
||||
bgcolor: 'rgba(255, 193, 7, 0.1)',
|
||||
border: '1px solid rgba(255, 193, 7, 0.3)',
|
||||
'&:hover': {
|
||||
bgcolor: 'rgba(255, 193, 7, 0.2)',
|
||||
transform: 'translateY(-1px)',
|
||||
boxShadow: '0 4px 12px rgba(255, 193, 7, 0.3)'
|
||||
},
|
||||
transition: 'all 0.3s ease',
|
||||
width: 36,
|
||||
height: 36
|
||||
}}
|
||||
>
|
||||
<Badge
|
||||
badgeContent={5}
|
||||
sx={{
|
||||
'& .MuiBadge-badge': {
|
||||
fontSize: '0.6rem',
|
||||
fontWeight: 'bold',
|
||||
animation: 'pulse 2s infinite',
|
||||
bgcolor: '#ff6b35',
|
||||
color: 'white'
|
||||
}
|
||||
}}
|
||||
>
|
||||
<AutoAwesomeIcon sx={{ fontSize: 16 }} />
|
||||
</Badge>
|
||||
</IconButton>
|
||||
</motion.div>
|
||||
</MuiTooltip>
|
||||
|
||||
{/* Data Source Transparency Button - Compact */}
|
||||
<MuiTooltip title="View data sources and transparency information" placement="top">
|
||||
<motion.div
|
||||
whileHover={{ scale: 1.05 }}
|
||||
whileTap={{ scale: 0.95 }}
|
||||
>
|
||||
<IconButton
|
||||
onClick={onShowDataSourceTransparency}
|
||||
sx={{
|
||||
color: 'primary.main',
|
||||
bgcolor: 'rgba(76, 175, 80, 0.1)',
|
||||
border: '1px solid rgba(76, 175, 80, 0.3)',
|
||||
'&:hover': {
|
||||
bgcolor: 'rgba(76, 175, 80, 0.2)',
|
||||
transform: 'translateY(-1px)',
|
||||
boxShadow: '0 4px 12px rgba(76, 175, 80, 0.3)'
|
||||
},
|
||||
transition: 'all 0.3s ease',
|
||||
width: 36,
|
||||
height: 36
|
||||
}}
|
||||
>
|
||||
<Badge
|
||||
badgeContent={Object.keys(autoPopulatedFields || {}).length}
|
||||
sx={{
|
||||
'& .MuiBadge-badge': {
|
||||
fontSize: '0.6rem',
|
||||
fontWeight: 'bold',
|
||||
animation: 'pulse 2s infinite',
|
||||
bgcolor: '#2196f3',
|
||||
color: 'white'
|
||||
}
|
||||
}}
|
||||
>
|
||||
<InfoIcon sx={{ fontSize: 16 }} />
|
||||
</Badge>
|
||||
</IconButton>
|
||||
</motion.div>
|
||||
</MuiTooltip>
|
||||
|
||||
{/* Refresh Button - Compact */}
|
||||
<MuiTooltip title="Refresh auto-populated data" placement="top">
|
||||
<motion.div
|
||||
whileHover={{ scale: 1.05 }}
|
||||
whileTap={{ scale: 0.95 }}
|
||||
>
|
||||
<IconButton
|
||||
onClick={onRefreshData}
|
||||
sx={{
|
||||
color: 'primary.main',
|
||||
bgcolor: 'rgba(0,0,0,0.05)',
|
||||
border: '1px solid rgba(0,0,0,0.1)',
|
||||
'&:hover': {
|
||||
bgcolor: 'rgba(0,0,0,0.1)',
|
||||
transform: 'translateY(-1px)',
|
||||
boxShadow: '0 4px 12px rgba(0,0,0,0.2)'
|
||||
},
|
||||
transition: 'all 0.3s ease',
|
||||
width: 36,
|
||||
height: 36
|
||||
}}
|
||||
>
|
||||
<RefreshIcon sx={{ fontSize: 16 }} />
|
||||
</IconButton>
|
||||
</motion.div>
|
||||
</MuiTooltip>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export default ProgressTracker;
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
|
||||
interface UseAutoPopulationProps {
|
||||
autoPopulateFromOnboarding: () => void;
|
||||
completionStats: any;
|
||||
}
|
||||
|
||||
export const useAutoPopulation = ({
|
||||
autoPopulateFromOnboarding,
|
||||
completionStats
|
||||
}: UseAutoPopulationProps) => {
|
||||
const [autoPopulateAttempted, setAutoPopulateAttempted] = useState(false);
|
||||
|
||||
// Auto-populate from onboarding on first load
|
||||
useEffect(() => {
|
||||
if (!autoPopulateAttempted) {
|
||||
autoPopulateFromOnboarding();
|
||||
setAutoPopulateAttempted(true);
|
||||
}
|
||||
}, [autoPopulateAttempted, autoPopulateFromOnboarding]);
|
||||
|
||||
return {
|
||||
autoPopulateAttempted,
|
||||
setAutoPopulateAttempted
|
||||
};
|
||||
};
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
|
||||
interface UseCategoryReviewProps {
|
||||
completionStats: any;
|
||||
setError: (error: string | null) => void;
|
||||
setActiveCategory: (category: string | null) => void;
|
||||
}
|
||||
|
||||
export const useCategoryReview = ({ completionStats, setError, setActiveCategory }: UseCategoryReviewProps) => {
|
||||
const [reviewedCategories, setReviewedCategories] = useState<Set<string>>(new Set());
|
||||
const [isMarkingReviewed, setIsMarkingReviewed] = useState(false);
|
||||
const [categoryCompletionMessage, setCategoryCompletionMessage] = useState<string | null>(null);
|
||||
|
||||
// Clear category completion message after 3 seconds
|
||||
useEffect(() => {
|
||||
if (categoryCompletionMessage) {
|
||||
const timer = setTimeout(() => {
|
||||
setCategoryCompletionMessage(null);
|
||||
}, 3000);
|
||||
return () => clearTimeout(timer);
|
||||
}
|
||||
}, [categoryCompletionMessage]);
|
||||
|
||||
const handleConfirmCategoryReview = async (activeCategory: string | null) => {
|
||||
if (!activeCategory) return;
|
||||
|
||||
setIsMarkingReviewed(true);
|
||||
setCategoryCompletionMessage('🔄 Marking category as reviewed...');
|
||||
|
||||
try {
|
||||
// Simulate processing time for better UX
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
|
||||
// Mark category as reviewed
|
||||
setReviewedCategories(prev => new Set([...Array.from(prev), activeCategory]));
|
||||
|
||||
// Get category name for display
|
||||
const categoryName = activeCategory.split('_').map(word =>
|
||||
word.charAt(0).toUpperCase() + word.slice(1)
|
||||
).join(' ');
|
||||
|
||||
setCategoryCompletionMessage(`✅ ${categoryName} reviewed and confirmed!`);
|
||||
|
||||
// Auto-navigate to next unreviewed category
|
||||
setTimeout(() => {
|
||||
const allCategories = Object.keys(completionStats.category_completion);
|
||||
const currentIndex = allCategories.indexOf(activeCategory);
|
||||
|
||||
// Use the updated reviewedCategories state that includes the current category
|
||||
const updatedReviewedCategories = new Set([...Array.from(reviewedCategories), activeCategory]);
|
||||
|
||||
console.log('🔍 Navigation Debug:', {
|
||||
activeCategory,
|
||||
currentIndex,
|
||||
allCategories,
|
||||
reviewedCategories: Array.from(reviewedCategories),
|
||||
updatedReviewedCategories: Array.from(updatedReviewedCategories)
|
||||
});
|
||||
|
||||
const nextUnreviewedCategory = allCategories.find((categoryId, index) => {
|
||||
if (index <= currentIndex) return false;
|
||||
return !updatedReviewedCategories.has(categoryId);
|
||||
});
|
||||
|
||||
console.log('🎯 Next Category Found:', nextUnreviewedCategory);
|
||||
|
||||
if (nextUnreviewedCategory) {
|
||||
// Actually navigate to the next category
|
||||
console.log('🚀 Navigating to:', nextUnreviewedCategory);
|
||||
setActiveCategory(nextUnreviewedCategory);
|
||||
setCategoryCompletionMessage(`🎯 Moving to next category: ${nextUnreviewedCategory.split('_').map(word =>
|
||||
word.charAt(0).toUpperCase() + word.slice(1)
|
||||
).join(' ')}`);
|
||||
} else {
|
||||
console.log('🎉 All categories reviewed!');
|
||||
setCategoryCompletionMessage('🎉 All categories reviewed and confirmed! You can now create your strategy.');
|
||||
}
|
||||
}, 1500);
|
||||
} catch (error: any) {
|
||||
setError(`Error marking category as reviewed: ${error.message || 'Unknown error'}`);
|
||||
console.error('Error in handleConfirmCategoryReview:', error);
|
||||
} finally {
|
||||
setIsMarkingReviewed(false);
|
||||
}
|
||||
};
|
||||
|
||||
const isCategoryReviewed = (categoryId: string) => {
|
||||
return reviewedCategories.has(categoryId);
|
||||
};
|
||||
|
||||
const getNextUnreviewedCategory = (currentCategoryId: string) => {
|
||||
const allCategories = Object.keys(completionStats.category_completion);
|
||||
const currentIndex = allCategories.indexOf(currentCategoryId);
|
||||
|
||||
// Use the updated reviewedCategories state that includes the current category
|
||||
const updatedReviewedCategories = new Set([...Array.from(reviewedCategories), currentCategoryId]);
|
||||
|
||||
return allCategories.find((categoryId, index) => {
|
||||
if (index <= currentIndex) return false;
|
||||
return !updatedReviewedCategories.has(categoryId);
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
reviewedCategories,
|
||||
isMarkingReviewed,
|
||||
categoryCompletionMessage,
|
||||
handleConfirmCategoryReview,
|
||||
isCategoryReviewed,
|
||||
getNextUnreviewedCategory,
|
||||
setReviewedCategories
|
||||
};
|
||||
};
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
import { useMemo } from 'react';
|
||||
|
||||
interface UseProgressTrackingProps {
|
||||
completionStats: any;
|
||||
reviewedCategories: Set<string>;
|
||||
}
|
||||
|
||||
export const useProgressTracking = ({ completionStats, reviewedCategories }: UseProgressTrackingProps) => {
|
||||
const progressData = useMemo(() => {
|
||||
const totalCategories = Object.keys(completionStats.category_completion).length;
|
||||
const reviewedCategoriesCount = reviewedCategories.size;
|
||||
const reviewProgressPercentage = (reviewedCategoriesCount / totalCategories) * 100;
|
||||
|
||||
return {
|
||||
totalCategories,
|
||||
reviewedCategoriesCount,
|
||||
reviewProgressPercentage
|
||||
};
|
||||
}, [completionStats.category_completion, reviewedCategories]);
|
||||
|
||||
const getCategoryProgress = (categoryId: string) => {
|
||||
return completionStats.category_completion[categoryId] || 0;
|
||||
};
|
||||
|
||||
const getCategoryStatus = (percentage: number) => {
|
||||
if (percentage >= 90) return { status: 'Complete', color: 'success' as const };
|
||||
if (percentage >= 70) return { status: 'Good', color: 'primary' as const };
|
||||
if (percentage >= 50) return { status: 'Fair', color: 'warning' as const };
|
||||
return { status: 'Needs Work', color: 'error' as const };
|
||||
};
|
||||
|
||||
const isNextInSequence = (categoryId: string, allCategories: string[]) => {
|
||||
const currentIndex = allCategories.indexOf(categoryId);
|
||||
return currentIndex > 0 &&
|
||||
allCategories.slice(0, currentIndex).every(cat =>
|
||||
reviewedCategories.has(cat)
|
||||
) &&
|
||||
!reviewedCategories.has(categoryId);
|
||||
};
|
||||
|
||||
return {
|
||||
...progressData,
|
||||
getCategoryProgress,
|
||||
getCategoryStatus,
|
||||
isNextInSequence
|
||||
};
|
||||
};
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
import React from 'react';
|
||||
import {
|
||||
Business as BusinessIcon,
|
||||
People as PeopleIcon,
|
||||
TrendingUp as TrendingUpIcon,
|
||||
ContentPaste as ContentIcon,
|
||||
Analytics as AnalyticsIcon,
|
||||
Help as HelpIcon
|
||||
} from '@mui/icons-material';
|
||||
|
||||
export const getCategoryIcon = (categoryId: string): React.ReactElement => {
|
||||
switch (categoryId) {
|
||||
case 'business_context': return <BusinessIcon />;
|
||||
case 'audience_intelligence': return <PeopleIcon />;
|
||||
case 'competitive_intelligence': return <TrendingUpIcon />;
|
||||
case 'content_strategy': return <ContentIcon />;
|
||||
case 'performance_analytics': return <AnalyticsIcon />;
|
||||
default: return <HelpIcon />;
|
||||
}
|
||||
};
|
||||
|
||||
export const getCategoryColor = (categoryId: string): string => {
|
||||
switch (categoryId) {
|
||||
case 'business_context': return 'primary';
|
||||
case 'audience_intelligence': return 'secondary';
|
||||
case 'competitive_intelligence': return 'success';
|
||||
case 'content_strategy': return 'warning';
|
||||
case 'performance_analytics': return 'info';
|
||||
default: return 'default';
|
||||
}
|
||||
};
|
||||
|
||||
export const getCategoryName = (categoryId: string): string => {
|
||||
return categoryId.split('_').map(word =>
|
||||
word.charAt(0).toUpperCase() + word.slice(1)
|
||||
).join(' ');
|
||||
};
|
||||
|
||||
export const getCategoryStatus = (percentage: number) => {
|
||||
if (percentage >= 90) return { status: 'Complete', color: 'success' as const };
|
||||
if (percentage >= 70) return { status: 'Good', color: 'primary' as const };
|
||||
if (percentage >= 50) return { status: 'Fair', color: 'warning' as const };
|
||||
return { status: 'Needs Work', color: 'error' as const };
|
||||
};
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
interface EducationalContent {
|
||||
title: string;
|
||||
description: string;
|
||||
points: string[];
|
||||
tips: string[];
|
||||
}
|
||||
|
||||
export const getEducationalContent = (categoryId: string): EducationalContent => {
|
||||
switch (categoryId) {
|
||||
case 'business_context':
|
||||
return {
|
||||
title: 'Business Context',
|
||||
description: 'Understanding your business foundation is crucial for content strategy success.',
|
||||
points: [
|
||||
'Business objectives define what you want to achieve through content',
|
||||
'Target metrics help measure the success of your content strategy',
|
||||
'Content budget determines the scope and scale of your content efforts',
|
||||
'Team size affects content production capacity and frequency',
|
||||
'Implementation timeline sets realistic expectations for strategy rollout'
|
||||
],
|
||||
tips: [
|
||||
'Be specific about your business goals',
|
||||
'Set measurable and achievable metrics',
|
||||
'Consider your available resources realistically'
|
||||
]
|
||||
};
|
||||
case 'audience_intelligence':
|
||||
return {
|
||||
title: 'Audience Intelligence',
|
||||
description: 'Deep understanding of your audience drives content relevance and engagement.',
|
||||
points: [
|
||||
'Content preferences reveal what formats resonate with your audience',
|
||||
'Consumption patterns show when and how your audience engages',
|
||||
'Pain points help create content that solves real problems',
|
||||
'Buying journey mapping guides content at each stage',
|
||||
'Seasonal trends identify content opportunities throughout the year'
|
||||
],
|
||||
tips: [
|
||||
'Research your audience thoroughly',
|
||||
'Create audience personas for better targeting',
|
||||
'Monitor engagement patterns regularly'
|
||||
]
|
||||
};
|
||||
case 'competitive_intelligence':
|
||||
return {
|
||||
title: 'Competitive Intelligence',
|
||||
description: 'Understanding your competitive landscape helps differentiate your content.',
|
||||
points: [
|
||||
'Top competitors analysis reveals content gaps and opportunities',
|
||||
'Competitor strategies show what works in your industry',
|
||||
'Market gaps identify underserved content areas',
|
||||
'Industry trends keep your content current and relevant',
|
||||
'Emerging trends provide first-mover advantages'
|
||||
],
|
||||
tips: [
|
||||
'Monitor competitors regularly',
|
||||
'Identify unique angles and perspectives',
|
||||
'Stay ahead of industry trends'
|
||||
]
|
||||
};
|
||||
case 'content_strategy':
|
||||
return {
|
||||
title: 'Content Strategy',
|
||||
description: 'Your content approach defines how you\'ll achieve your business objectives.',
|
||||
points: [
|
||||
'Preferred formats align with audience preferences and business goals',
|
||||
'Content mix balances different types of content for maximum impact',
|
||||
'Content frequency should match audience expectations and team capacity',
|
||||
'Optimal timing maximizes content visibility and engagement',
|
||||
'Quality metrics ensure content meets audience standards'
|
||||
],
|
||||
tips: [
|
||||
'Balance audience preferences with business goals',
|
||||
'Set realistic content production schedules',
|
||||
'Maintain consistent quality standards'
|
||||
]
|
||||
};
|
||||
case 'performance_analytics':
|
||||
return {
|
||||
title: 'Performance & Analytics',
|
||||
description: 'Data-driven insights optimize your content strategy for better results.',
|
||||
points: [
|
||||
'Traffic sources show where your audience comes from',
|
||||
'Conversion rates measure content effectiveness',
|
||||
'ROI targets help justify content marketing investments',
|
||||
'A/B testing capabilities enable continuous optimization',
|
||||
'Regular analysis identifies improvement opportunities'
|
||||
],
|
||||
tips: [
|
||||
'Track key metrics consistently',
|
||||
'Use data to inform content decisions',
|
||||
'Continuously optimize based on performance'
|
||||
]
|
||||
};
|
||||
default:
|
||||
return {
|
||||
title: 'Category Information',
|
||||
description: 'Learn more about this content strategy category.',
|
||||
points: [],
|
||||
tips: []
|
||||
};
|
||||
}
|
||||
};
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
export const calculateReviewProgress = (reviewedCategories: Set<string>, totalCategories: number): number => {
|
||||
return (reviewedCategories.size / totalCategories) * 100;
|
||||
};
|
||||
|
||||
export const calculateCategoryProgress = (filledFields: number, totalFields: number): number => {
|
||||
return totalFields > 0 ? (filledFields / totalFields) * 100 : 0;
|
||||
};
|
||||
|
||||
export const getProgressColor = (percentage: number): string => {
|
||||
if (percentage >= 90) return 'success';
|
||||
if (percentage >= 70) return 'primary';
|
||||
if (percentage >= 50) return 'warning';
|
||||
return 'error';
|
||||
};
|
||||
|
||||
export const formatProgressPercentage = (percentage: number): string => {
|
||||
return `${Math.round(percentage)}%`;
|
||||
};
|
||||
|
||||
export const getProgressMessage = (percentage: number): string => {
|
||||
if (percentage >= 100) return 'Complete';
|
||||
if (percentage >= 90) return 'Almost Complete';
|
||||
if (percentage >= 70) return 'Good Progress';
|
||||
if (percentage >= 50) return 'Halfway There';
|
||||
if (percentage >= 30) return 'Getting Started';
|
||||
return 'Needs Work';
|
||||
};
|
||||
-945
@@ -1,945 +0,0 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import {
|
||||
Box,
|
||||
Paper,
|
||||
Typography,
|
||||
Button,
|
||||
LinearProgress,
|
||||
Alert,
|
||||
Chip,
|
||||
IconButton,
|
||||
Tooltip as MuiTooltip,
|
||||
Card,
|
||||
CardContent,
|
||||
Grid,
|
||||
Divider,
|
||||
CircularProgress,
|
||||
Badge,
|
||||
Collapse,
|
||||
Accordion,
|
||||
AccordionSummary,
|
||||
AccordionDetails,
|
||||
List,
|
||||
ListItem,
|
||||
ListItemIcon,
|
||||
ListItemText,
|
||||
Dialog,
|
||||
DialogTitle,
|
||||
DialogContent,
|
||||
DialogActions
|
||||
} from '@mui/material';
|
||||
import {
|
||||
Business as BusinessIcon,
|
||||
People as PeopleIcon,
|
||||
TrendingUp as TrendingUpIcon,
|
||||
ContentPaste as ContentIcon,
|
||||
Analytics as AnalyticsIcon,
|
||||
Help as HelpIcon,
|
||||
CheckCircle as CheckCircleIcon,
|
||||
Warning as WarningIcon,
|
||||
AutoAwesome as AutoAwesomeIcon,
|
||||
Refresh as RefreshIcon,
|
||||
Save as SaveIcon,
|
||||
ArrowForward as ArrowForwardIcon,
|
||||
ArrowBack as ArrowBackIcon,
|
||||
Assessment as AssessmentIcon,
|
||||
ExpandMore as ExpandMoreIcon,
|
||||
Info as InfoIcon,
|
||||
Visibility as VisibilityIcon,
|
||||
School as SchoolIcon,
|
||||
Lightbulb as LightbulbIcon,
|
||||
Psychology as PsychologyIcon,
|
||||
Timeline as TimelineIcon
|
||||
} from '@mui/icons-material';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import { useEnhancedStrategyStore, STRATEGIC_INPUT_FIELDS } from '../../../stores/enhancedStrategyStore';
|
||||
import StrategicInputField from './StrategicInputField';
|
||||
import EnhancedTooltip from './EnhancedTooltip';
|
||||
import AIRecommendationsPanel from './AIRecommendationsPanel';
|
||||
import DataSourceTransparency from './DataSourceTransparency';
|
||||
|
||||
const EnhancedStrategyBuilder: React.FC = () => {
|
||||
const {
|
||||
formData,
|
||||
formErrors,
|
||||
autoPopulatedFields,
|
||||
dataSources,
|
||||
loading,
|
||||
error,
|
||||
saving,
|
||||
aiGenerating,
|
||||
currentStep,
|
||||
completedSteps,
|
||||
disclosureSteps,
|
||||
currentStrategy,
|
||||
updateFormField,
|
||||
validateFormField,
|
||||
validateAllFields,
|
||||
completeStep,
|
||||
getNextStep,
|
||||
getPreviousStep,
|
||||
setCurrentStep,
|
||||
canProceedToStep,
|
||||
resetForm,
|
||||
autoPopulateFromOnboarding,
|
||||
generateAIRecommendations,
|
||||
createEnhancedStrategy,
|
||||
calculateCompletionPercentage,
|
||||
getCompletionStats,
|
||||
setError,
|
||||
setCurrentStrategy,
|
||||
setAIGenerating,
|
||||
setSaving
|
||||
} = useEnhancedStrategyStore();
|
||||
|
||||
const [showTooltip, setShowTooltip] = useState<string | null>(null);
|
||||
const [autoPopulateAttempted, setAutoPopulateAttempted] = useState(false);
|
||||
const [activeCategory, setActiveCategory] = useState<string | null>(null);
|
||||
const [showEducationalInfo, setShowEducationalInfo] = useState<string | null>(null);
|
||||
const [showAIRecommendations, setShowAIRecommendations] = useState(false);
|
||||
const [showDataSourceTransparency, setShowDataSourceTransparency] = useState(false);
|
||||
|
||||
// Auto-populate from onboarding on first load
|
||||
useEffect(() => {
|
||||
if (!autoPopulateAttempted) {
|
||||
autoPopulateFromOnboarding();
|
||||
setAutoPopulateAttempted(true);
|
||||
}
|
||||
}, [autoPopulateAttempted, autoPopulateFromOnboarding]);
|
||||
|
||||
const handleCreateStrategy = async () => {
|
||||
try {
|
||||
setAIGenerating(true);
|
||||
setError(null);
|
||||
|
||||
console.log('Starting strategy creation...');
|
||||
console.log('Current formData:', formData);
|
||||
console.log('FormData ID:', formData.id);
|
||||
|
||||
// If we have a saved strategy, use its ID
|
||||
if (formData.id) {
|
||||
console.log('Using existing strategy ID:', formData.id);
|
||||
await generateAIRecommendations(formData.id);
|
||||
} else {
|
||||
console.log('No strategy ID found, creating new strategy...');
|
||||
// If no strategy is saved yet, save it first, then generate AI insights
|
||||
const isValid = validateAllFields();
|
||||
console.log('Form validation result:', isValid);
|
||||
|
||||
if (isValid) {
|
||||
const completionStats = getCompletionStats();
|
||||
const strategyData = {
|
||||
...formData,
|
||||
completion_percentage: completionStats.completion_percentage,
|
||||
user_id: 1, // This would come from auth context
|
||||
name: formData.name || 'Enhanced Content Strategy',
|
||||
industry: formData.industry || 'General'
|
||||
};
|
||||
|
||||
console.log('Attempting to create strategy with data:', strategyData);
|
||||
const newStrategy = await createEnhancedStrategy(strategyData);
|
||||
console.log('New strategy created:', newStrategy);
|
||||
|
||||
if (newStrategy && newStrategy.id) {
|
||||
console.log('Generating AI recommendations for new strategy ID:', newStrategy.id);
|
||||
await generateAIRecommendations(newStrategy.id);
|
||||
|
||||
// Set the current strategy and show success message
|
||||
setCurrentStrategy(newStrategy);
|
||||
setError(null); // Clear any previous errors
|
||||
|
||||
// Show success message
|
||||
setTimeout(() => {
|
||||
setError('Strategy created successfully! Check the Strategic Intelligence tab for detailed insights.');
|
||||
}, 100);
|
||||
|
||||
// Auto-switch to Strategic Intelligence tab after creation
|
||||
// This would need to be handled by the parent component
|
||||
} else {
|
||||
setError('Failed to create strategy or get strategy ID for AI generation.');
|
||||
console.error('Failed to create strategy or get strategy ID for AI generation.');
|
||||
}
|
||||
} else {
|
||||
setError('Please fill in all required fields before generating AI insights.');
|
||||
console.error('Form validation failed. Cannot generate AI insights.');
|
||||
}
|
||||
}
|
||||
} catch (err: any) {
|
||||
setError(`Error generating AI recommendations: ${err.message || 'Unknown error'}`);
|
||||
console.error('Error in handleCreateStrategy:', err);
|
||||
} finally {
|
||||
setAIGenerating(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleSaveStrategy = async () => {
|
||||
try {
|
||||
setSaving(true);
|
||||
setError(null);
|
||||
|
||||
const completionStats = getCompletionStats();
|
||||
const strategyData = {
|
||||
...formData,
|
||||
completion_percentage: completionStats.completion_percentage,
|
||||
user_id: 1,
|
||||
name: formData.name || 'Enhanced Content Strategy',
|
||||
industry: formData.industry || 'General'
|
||||
};
|
||||
|
||||
const newStrategy = await createEnhancedStrategy(strategyData);
|
||||
setCurrentStrategy(newStrategy);
|
||||
setError('Strategy saved successfully!');
|
||||
} catch (err: any) {
|
||||
setError(`Error saving strategy: ${err.message || 'Unknown error'}`);
|
||||
} finally {
|
||||
setSaving(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleReviewCategory = (categoryId: string) => {
|
||||
setActiveCategory(activeCategory === categoryId ? null : categoryId);
|
||||
};
|
||||
|
||||
const handleShowEducationalInfo = (categoryId: string) => {
|
||||
setShowEducationalInfo(showEducationalInfo === categoryId ? null : categoryId);
|
||||
};
|
||||
|
||||
const getCategoryIcon = (categoryId: string) => {
|
||||
switch (categoryId) {
|
||||
case 'business_context': return <BusinessIcon />;
|
||||
case 'audience_intelligence': return <PeopleIcon />;
|
||||
case 'competitive_intelligence': return <TrendingUpIcon />;
|
||||
case 'content_strategy': return <ContentIcon />;
|
||||
case 'performance_analytics': return <AnalyticsIcon />;
|
||||
default: return <HelpIcon />;
|
||||
}
|
||||
};
|
||||
|
||||
const getCategoryColor = (categoryId: string) => {
|
||||
switch (categoryId) {
|
||||
case 'business_context': return 'primary';
|
||||
case 'audience_intelligence': return 'secondary';
|
||||
case 'competitive_intelligence': return 'success';
|
||||
case 'content_strategy': return 'warning';
|
||||
case 'performance_analytics': return 'info';
|
||||
default: return 'default';
|
||||
}
|
||||
};
|
||||
|
||||
const getEducationalContent = (categoryId: string) => {
|
||||
switch (categoryId) {
|
||||
case 'business_context':
|
||||
return {
|
||||
title: 'Business Context',
|
||||
description: 'Understanding your business foundation is crucial for content strategy success.',
|
||||
points: [
|
||||
'Business objectives define what you want to achieve through content',
|
||||
'Target metrics help measure the success of your content strategy',
|
||||
'Content budget determines the scope and scale of your content efforts',
|
||||
'Team size affects content production capacity and frequency',
|
||||
'Implementation timeline sets realistic expectations for strategy rollout'
|
||||
],
|
||||
tips: [
|
||||
'Be specific about your business goals',
|
||||
'Set measurable and achievable metrics',
|
||||
'Consider your available resources realistically'
|
||||
]
|
||||
};
|
||||
case 'audience_intelligence':
|
||||
return {
|
||||
title: 'Audience Intelligence',
|
||||
description: 'Deep understanding of your audience drives content relevance and engagement.',
|
||||
points: [
|
||||
'Content preferences reveal what formats resonate with your audience',
|
||||
'Consumption patterns show when and how your audience engages',
|
||||
'Pain points help create content that solves real problems',
|
||||
'Buying journey mapping guides content at each stage',
|
||||
'Seasonal trends identify content opportunities throughout the year'
|
||||
],
|
||||
tips: [
|
||||
'Research your audience thoroughly',
|
||||
'Create audience personas for better targeting',
|
||||
'Monitor engagement patterns regularly'
|
||||
]
|
||||
};
|
||||
case 'competitive_intelligence':
|
||||
return {
|
||||
title: 'Competitive Intelligence',
|
||||
description: 'Understanding your competitive landscape helps differentiate your content.',
|
||||
points: [
|
||||
'Top competitors analysis reveals content gaps and opportunities',
|
||||
'Competitor strategies show what works in your industry',
|
||||
'Market gaps identify underserved content areas',
|
||||
'Industry trends keep your content current and relevant',
|
||||
'Emerging trends provide first-mover advantages'
|
||||
],
|
||||
tips: [
|
||||
'Monitor competitors regularly',
|
||||
'Identify unique angles and perspectives',
|
||||
'Stay ahead of industry trends'
|
||||
]
|
||||
};
|
||||
case 'content_strategy':
|
||||
return {
|
||||
title: 'Content Strategy',
|
||||
description: 'Your content approach defines how you\'ll achieve your business objectives.',
|
||||
points: [
|
||||
'Preferred formats align with audience preferences and business goals',
|
||||
'Content mix balances different types of content for maximum impact',
|
||||
'Content frequency should match audience expectations and team capacity',
|
||||
'Optimal timing maximizes content visibility and engagement',
|
||||
'Quality metrics ensure content meets audience standards'
|
||||
],
|
||||
tips: [
|
||||
'Balance audience preferences with business goals',
|
||||
'Set realistic content production schedules',
|
||||
'Maintain consistent quality standards'
|
||||
]
|
||||
};
|
||||
case 'performance_analytics':
|
||||
return {
|
||||
title: 'Performance & Analytics',
|
||||
description: 'Data-driven insights optimize your content strategy for better results.',
|
||||
points: [
|
||||
'Traffic sources show where your audience comes from',
|
||||
'Conversion rates measure content effectiveness',
|
||||
'ROI targets help justify content marketing investments',
|
||||
'A/B testing capabilities enable continuous optimization',
|
||||
'Regular analysis identifies improvement opportunities'
|
||||
],
|
||||
tips: [
|
||||
'Track key metrics consistently',
|
||||
'Use data to inform content decisions',
|
||||
'Continuously optimize based on performance'
|
||||
]
|
||||
};
|
||||
default:
|
||||
return {
|
||||
title: 'Category Information',
|
||||
description: 'Learn more about this content strategy category.',
|
||||
points: [],
|
||||
tips: []
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
const completionStats = getCompletionStats();
|
||||
const completionPercentage = calculateCompletionPercentage();
|
||||
|
||||
return (
|
||||
<Box sx={{ p: 3 }}>
|
||||
{/* Header with Title (Region B) */}
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: -20 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ duration: 0.5 }}
|
||||
>
|
||||
<Paper
|
||||
sx={{
|
||||
p: 3,
|
||||
mb: 3,
|
||||
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
||||
color: 'white',
|
||||
borderRadius: 2
|
||||
}}
|
||||
>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
||||
<Box>
|
||||
<Typography variant="h4" gutterBottom sx={{ fontWeight: 'bold' }}>
|
||||
Enhanced Strategy Builder
|
||||
</Typography>
|
||||
<Typography variant="body1" sx={{ opacity: 0.9 }}>
|
||||
Build a comprehensive content strategy with 30+ strategic inputs
|
||||
</Typography>
|
||||
</Box>
|
||||
<Box sx={{ display: 'flex', gap: 1 }}>
|
||||
{/* AI Recommendations Button */}
|
||||
<MuiTooltip title="View AI-powered recommendations and insights" placement="top">
|
||||
<IconButton
|
||||
onClick={() => setShowAIRecommendations(true)}
|
||||
sx={{
|
||||
color: 'white',
|
||||
bgcolor: 'rgba(255,255,255,0.1)',
|
||||
'&:hover': { bgcolor: 'rgba(255,255,255,0.2)' }
|
||||
}}
|
||||
>
|
||||
<Badge badgeContent={5} color="secondary">
|
||||
<AutoAwesomeIcon />
|
||||
</Badge>
|
||||
</IconButton>
|
||||
</MuiTooltip>
|
||||
|
||||
{/* Data Source Transparency Button */}
|
||||
<MuiTooltip title="View data sources and transparency information" placement="top">
|
||||
<IconButton
|
||||
onClick={() => setShowDataSourceTransparency(true)}
|
||||
sx={{
|
||||
color: 'white',
|
||||
bgcolor: 'rgba(255,255,255,0.1)',
|
||||
'&:hover': { bgcolor: 'rgba(255,255,255,0.2)' }
|
||||
}}
|
||||
>
|
||||
<Badge badgeContent={Object.keys(autoPopulatedFields || {}).length} color="info">
|
||||
<InfoIcon />
|
||||
</Badge>
|
||||
</IconButton>
|
||||
</MuiTooltip>
|
||||
|
||||
{/* Refresh Button */}
|
||||
<MuiTooltip title="Refresh auto-populated data" placement="top">
|
||||
<IconButton
|
||||
onClick={autoPopulateFromOnboarding}
|
||||
sx={{
|
||||
color: 'white',
|
||||
bgcolor: 'rgba(255,255,255,0.1)',
|
||||
'&:hover': { bgcolor: 'rgba(255,255,255,0.2)' }
|
||||
}}
|
||||
>
|
||||
<RefreshIcon />
|
||||
</IconButton>
|
||||
</MuiTooltip>
|
||||
</Box>
|
||||
</Box>
|
||||
</Paper>
|
||||
</motion.div>
|
||||
|
||||
{/* Error Alert */}
|
||||
{error && (
|
||||
<Alert severity="error" sx={{ mb: 3 }}>
|
||||
{error}
|
||||
</Alert>
|
||||
)}
|
||||
|
||||
{/* Success Alert */}
|
||||
{!error && currentStrategy && (
|
||||
<Alert severity="success" sx={{ mb: 3 }}>
|
||||
Strategy "{currentStrategy.name}" created successfully! Check the Strategic Intelligence tab for detailed insights.
|
||||
</Alert>
|
||||
)}
|
||||
|
||||
{/* Strategy Display */}
|
||||
{currentStrategy && (
|
||||
<Paper sx={{ p: 3, mb: 3 }}>
|
||||
<Typography variant="h5" gutterBottom>
|
||||
Created Strategy: {currentStrategy.name}
|
||||
</Typography>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={12} md={6}>
|
||||
<Typography variant="subtitle1" color="text.secondary">
|
||||
Industry: {currentStrategy.industry}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1" color="text.secondary">
|
||||
Completion: {currentStrategy.completion_percentage}%
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={6}>
|
||||
<Typography variant="subtitle1" color="text.secondary">
|
||||
Created: {new Date(currentStrategy.created_at).toLocaleDateString()}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1" color="text.secondary">
|
||||
ID: {currentStrategy.id}
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Box sx={{ mt: 2 }}>
|
||||
<Button
|
||||
variant="outlined"
|
||||
onClick={() => window.location.href = '/content-planning?tab=strategic-intelligence'}
|
||||
startIcon={<AssessmentIcon />}
|
||||
>
|
||||
View Strategic Intelligence
|
||||
</Button>
|
||||
</Box>
|
||||
</Paper>
|
||||
)}
|
||||
|
||||
{/* Auto-population Status */}
|
||||
{autoPopulatedFields && Object.keys(autoPopulatedFields).length > 0 && (
|
||||
<Alert
|
||||
severity="info"
|
||||
sx={{ mb: 3 }}
|
||||
action={
|
||||
<Button color="inherit" size="small" onClick={autoPopulateFromOnboarding}>
|
||||
<RefreshIcon />
|
||||
</Button>
|
||||
}
|
||||
>
|
||||
{autoPopulatedFields && Object.keys(autoPopulatedFields).length} fields auto-populated from onboarding data
|
||||
</Alert>
|
||||
)}
|
||||
|
||||
<Grid container spacing={3}>
|
||||
{/* Category Overview Panel */}
|
||||
<Grid item xs={12} md={4}>
|
||||
<Paper sx={{ p: 3, height: 'fit-content', position: 'sticky', top: 20 }}>
|
||||
{/* Enhanced Completion Tracker - Integrated into Category List */}
|
||||
<Box sx={{ mb: 3 }}>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Strategy Progress
|
||||
</Typography>
|
||||
|
||||
{/* Overall Progress with Status */}
|
||||
<Box sx={{ mb: 2 }}>
|
||||
<Box sx={{ display: 'flex', justifyContent: 'space-between', mb: 1 }}>
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
Overall Completion
|
||||
</Typography>
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
{Math.round(completionPercentage)}%
|
||||
</Typography>
|
||||
</Box>
|
||||
<LinearProgress
|
||||
variant="determinate"
|
||||
value={completionPercentage}
|
||||
sx={{ height: 8, borderRadius: 4 }}
|
||||
/>
|
||||
<Typography variant="caption" color="text.secondary" sx={{ mt: 1, display: 'block' }}>
|
||||
{completionStats.filled_fields} of {completionStats.total_fields} fields completed
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
{/* Status Chip */}
|
||||
<Box sx={{ mb: 2 }}>
|
||||
<Chip
|
||||
label={
|
||||
completionPercentage >= 90 ? 'Excellent' :
|
||||
completionPercentage >= 70 ? 'Good' :
|
||||
completionPercentage >= 50 ? 'Fair' : 'Needs Work'
|
||||
}
|
||||
color={
|
||||
completionPercentage >= 90 ? 'success' :
|
||||
completionPercentage >= 70 ? 'primary' :
|
||||
completionPercentage >= 50 ? 'warning' : 'error'
|
||||
}
|
||||
size="small"
|
||||
icon={<TrendingUpIcon />}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
{/* Motivational Message */}
|
||||
{completionPercentage > 0 && completionPercentage < 100 && (
|
||||
<Alert severity="info" sx={{ mb: 2 }}>
|
||||
<Typography variant="body2">
|
||||
{completionPercentage < 30 && "Great start! Keep going to unlock AI insights."}
|
||||
{completionPercentage >= 30 && completionPercentage < 60 && "You're making excellent progress! Consider reviewing completed categories."}
|
||||
{completionPercentage >= 60 && completionPercentage < 90 && "Almost there! Just a few more fields to complete your strategy."}
|
||||
{completionPercentage >= 90 && "Excellent work! Your strategy is nearly complete."}
|
||||
</Typography>
|
||||
</Alert>
|
||||
)}
|
||||
|
||||
{/* Status Indicators */}
|
||||
<Box sx={{ mb: 2 }}>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1, mb: 1 }}>
|
||||
<CheckCircleIcon color="success" fontSize="small" />
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
Auto-population: {Object.keys(autoPopulatedFields || {}).length} fields
|
||||
</Typography>
|
||||
</Box>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
<AutoAwesomeIcon color="primary" fontSize="small" />
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
AI Insights: {aiGenerating ? 'Generating...' : 'Ready'}
|
||||
</Typography>
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
{/* Category Progress - Integrated with CompletionTracker functionality */}
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Category Progress
|
||||
</Typography>
|
||||
|
||||
<List sx={{ p: 0 }}>
|
||||
{Object.entries(completionStats.category_completion).map(([categoryId, percentage]) => {
|
||||
const category = STRATEGIC_INPUT_FIELDS.find(f => f.category === categoryId);
|
||||
const categoryName = categoryId.split('_').map(word =>
|
||||
word.charAt(0).toUpperCase() + word.slice(1)
|
||||
).join(' ');
|
||||
|
||||
// Get category-specific stats
|
||||
const categoryFields = STRATEGIC_INPUT_FIELDS.filter(f => f.category === categoryId);
|
||||
const filledFields = categoryFields.filter(field => formData[field.id]).length;
|
||||
const totalFields = categoryFields.length;
|
||||
|
||||
// Get status for this category
|
||||
const getCategoryStatus = (percentage: number) => {
|
||||
if (percentage >= 90) return { status: 'Complete', color: 'success' as const };
|
||||
if (percentage >= 70) return { status: 'Good', color: 'primary' as const };
|
||||
if (percentage >= 50) return { status: 'Fair', color: 'warning' as const };
|
||||
return { status: 'Needs Work', color: 'error' as const };
|
||||
};
|
||||
|
||||
const categoryStatus = getCategoryStatus(percentage);
|
||||
|
||||
return (
|
||||
<motion.div
|
||||
key={categoryId}
|
||||
initial={{ opacity: 0, x: -20 }}
|
||||
animate={{ opacity: 1, x: 0 }}
|
||||
transition={{ duration: 0.3 }}
|
||||
>
|
||||
<ListItem
|
||||
sx={{
|
||||
p: 2,
|
||||
mb: 1,
|
||||
borderRadius: 2,
|
||||
bgcolor: activeCategory === categoryId ? 'action.hover' : 'transparent',
|
||||
border: activeCategory === categoryId ? '2px solid' : '1px solid',
|
||||
borderColor: activeCategory === categoryId ? 'primary.main' : 'divider',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'stretch'
|
||||
}}
|
||||
>
|
||||
{/* Category Header */}
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', width: '100%', mb: 1 }}>
|
||||
<ListItemIcon>
|
||||
{getCategoryIcon(categoryId)}
|
||||
</ListItemIcon>
|
||||
<ListItemText
|
||||
primary={categoryName}
|
||||
secondary={`${Math.round(percentage)}% complete`}
|
||||
sx={{ flex: 1 }}
|
||||
/>
|
||||
<Chip
|
||||
label={categoryStatus.status}
|
||||
color={categoryStatus.color}
|
||||
size="small"
|
||||
sx={{ mr: 1 }}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
{/* Category Progress Bar */}
|
||||
<Box sx={{ mb: 1 }}>
|
||||
<LinearProgress
|
||||
variant="determinate"
|
||||
value={percentage}
|
||||
sx={{
|
||||
height: 4,
|
||||
borderRadius: 2,
|
||||
bgcolor: 'action.hover'
|
||||
}}
|
||||
/>
|
||||
<Typography variant="caption" color="text.secondary" sx={{ mt: 0.5, display: 'block' }}>
|
||||
{filledFields} of {totalFields} fields completed
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
{/* Category Actions */}
|
||||
<Box sx={{ display: 'flex', gap: 1, justifyContent: 'space-between', alignItems: 'center' }}>
|
||||
<Box sx={{ display: 'flex', gap: 1 }}>
|
||||
{/* Review Button */}
|
||||
<Button
|
||||
size="small"
|
||||
variant="outlined"
|
||||
startIcon={<VisibilityIcon />}
|
||||
onClick={() => handleReviewCategory(categoryId)}
|
||||
sx={{ minWidth: 'auto' }}
|
||||
>
|
||||
Review
|
||||
</Button>
|
||||
|
||||
{/* Educational Info Button */}
|
||||
<IconButton
|
||||
size="small"
|
||||
onClick={() => handleShowEducationalInfo(categoryId)}
|
||||
sx={{ color: 'primary.main' }}
|
||||
>
|
||||
<SchoolIcon />
|
||||
</IconButton>
|
||||
</Box>
|
||||
|
||||
{/* Category Status Indicator */}
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>
|
||||
{percentage >= 90 ? (
|
||||
<CheckCircleIcon color="success" fontSize="small" />
|
||||
) : percentage >= 70 ? (
|
||||
<TrendingUpIcon color="primary" fontSize="small" />
|
||||
) : (
|
||||
<WarningIcon color="warning" fontSize="small" />
|
||||
)}
|
||||
</Box>
|
||||
</Box>
|
||||
</ListItem>
|
||||
</motion.div>
|
||||
);
|
||||
})}
|
||||
</List>
|
||||
|
||||
{/* Quick Actions */}
|
||||
<Box sx={{ mt: 3, pt: 2, borderTop: 1, borderColor: 'divider' }}>
|
||||
<Typography variant="subtitle2" gutterBottom>
|
||||
Quick Actions
|
||||
</Typography>
|
||||
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 1 }}>
|
||||
<Button
|
||||
size="small"
|
||||
variant="outlined"
|
||||
startIcon={<AutoAwesomeIcon />}
|
||||
onClick={() => setShowAIRecommendations(true)}
|
||||
fullWidth
|
||||
>
|
||||
View AI Insights
|
||||
</Button>
|
||||
<Button
|
||||
size="small"
|
||||
variant="outlined"
|
||||
startIcon={<InfoIcon />}
|
||||
onClick={() => setShowDataSourceTransparency(true)}
|
||||
fullWidth
|
||||
>
|
||||
View Data Sources
|
||||
</Button>
|
||||
<Button
|
||||
size="small"
|
||||
variant="outlined"
|
||||
startIcon={<RefreshIcon />}
|
||||
onClick={autoPopulateFromOnboarding}
|
||||
fullWidth
|
||||
>
|
||||
Refresh Data
|
||||
</Button>
|
||||
</Box>
|
||||
</Box>
|
||||
</Paper>
|
||||
</Grid>
|
||||
|
||||
{/* Main Content Area */}
|
||||
<Grid item xs={12} md={8}>
|
||||
<Paper sx={{ p: 3, minHeight: '600px' }}>
|
||||
{activeCategory ? (
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: 20 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ duration: 0.3 }}
|
||||
>
|
||||
{/* Category Header */}
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', mb: 3 }}>
|
||||
{getCategoryIcon(activeCategory)}
|
||||
<Typography variant="h5" sx={{ ml: 1 }}>
|
||||
{activeCategory.split('_').map(word =>
|
||||
word.charAt(0).toUpperCase() + word.slice(1)
|
||||
).join(' ')}
|
||||
</Typography>
|
||||
<Chip
|
||||
label={`${Math.round(completionStats.category_completion[activeCategory])}% Complete`}
|
||||
color={getCategoryColor(activeCategory) as any}
|
||||
sx={{ ml: 'auto' }}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
{/* Educational Info Dialog */}
|
||||
<Dialog
|
||||
open={!!showEducationalInfo}
|
||||
onClose={() => setShowEducationalInfo(null)}
|
||||
maxWidth="md"
|
||||
fullWidth
|
||||
>
|
||||
<DialogTitle>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
<SchoolIcon />
|
||||
{showEducationalInfo && getEducationalContent(showEducationalInfo).title}
|
||||
</Box>
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<Typography variant="body1" paragraph>
|
||||
{showEducationalInfo && getEducationalContent(showEducationalInfo).description}
|
||||
</Typography>
|
||||
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Key Points:
|
||||
</Typography>
|
||||
<List>
|
||||
{showEducationalInfo && getEducationalContent(showEducationalInfo).points.map((point, index) => (
|
||||
<ListItem key={index} sx={{ py: 0.5 }}>
|
||||
<ListItemIcon>
|
||||
<LightbulbIcon color="primary" fontSize="small" />
|
||||
</ListItemIcon>
|
||||
<ListItemText primary={point} />
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Pro Tips:
|
||||
</Typography>
|
||||
<List>
|
||||
{showEducationalInfo && getEducationalContent(showEducationalInfo).tips.map((tip, index) => (
|
||||
<ListItem key={index} sx={{ py: 0.5 }}>
|
||||
<ListItemIcon>
|
||||
<PsychologyIcon color="secondary" fontSize="small" />
|
||||
</ListItemIcon>
|
||||
<ListItemText primary={tip} />
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={() => setShowEducationalInfo(null)}>
|
||||
Got it!
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
|
||||
{/* Category Fields */}
|
||||
<Grid container spacing={2}>
|
||||
{STRATEGIC_INPUT_FIELDS
|
||||
.filter(field => field.category === activeCategory)
|
||||
.map((field) => (
|
||||
<Grid item xs={12} key={field.id}>
|
||||
<StrategicInputField
|
||||
fieldId={field.id}
|
||||
value={formData[field.id]}
|
||||
error={formErrors[field.id]}
|
||||
autoPopulated={!!autoPopulatedFields[field.id]}
|
||||
dataSource={dataSources[field.id]}
|
||||
onChange={(value: any) => updateFormField(field.id, value)}
|
||||
onValidate={() => validateFormField(field.id)}
|
||||
onShowTooltip={() => setShowTooltip(field.id)}
|
||||
/>
|
||||
</Grid>
|
||||
))}
|
||||
</Grid>
|
||||
|
||||
{/* Category Actions */}
|
||||
<Box sx={{ mt: 3, display: 'flex', gap: 2 }}>
|
||||
<Button
|
||||
variant="contained"
|
||||
onClick={() => {
|
||||
// Mark category as complete
|
||||
const categoryFields = STRATEGIC_INPUT_FIELDS.filter(f => f.category === activeCategory);
|
||||
const allFieldsFilled = categoryFields.every(field => formData[field.id]);
|
||||
if (allFieldsFilled) {
|
||||
completeStep(activeCategory);
|
||||
setActiveCategory(null);
|
||||
}
|
||||
}}
|
||||
disabled={!STRATEGIC_INPUT_FIELDS
|
||||
.filter(f => f.category === activeCategory)
|
||||
.every(field => formData[field.id])}
|
||||
>
|
||||
Complete Category
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
variant="outlined"
|
||||
onClick={() => setActiveCategory(null)}
|
||||
>
|
||||
Back to Overview
|
||||
</Button>
|
||||
</Box>
|
||||
</motion.div>
|
||||
) : (
|
||||
<motion.div
|
||||
initial={{ opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
transition={{ duration: 0.3 }}
|
||||
>
|
||||
<Box sx={{ textAlign: 'center', py: 8 }}>
|
||||
<TimelineIcon sx={{ fontSize: 64, color: 'text.secondary', mb: 2 }} />
|
||||
<Typography variant="h5" gutterBottom>
|
||||
Select a Category to Review
|
||||
</Typography>
|
||||
<Typography variant="body1" color="text.secondary">
|
||||
Click on any category from the left panel to review and complete the fields.
|
||||
</Typography>
|
||||
</Box>
|
||||
</motion.div>
|
||||
)}
|
||||
</Paper>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
{/* Action Buttons */}
|
||||
<Box sx={{ mt: 3, display: 'flex', gap: 2, justifyContent: 'flex-end' }}>
|
||||
<MuiTooltip
|
||||
title={completionPercentage < 20 ? `Complete at least 20% of the form (currently ${Math.round(completionPercentage)}%)` : 'Create a comprehensive content strategy with AI insights'}
|
||||
placement="top"
|
||||
>
|
||||
<span>
|
||||
<Button
|
||||
variant="outlined"
|
||||
startIcon={<AutoAwesomeIcon />}
|
||||
onClick={handleCreateStrategy}
|
||||
disabled={aiGenerating || completionPercentage < 20}
|
||||
>
|
||||
{aiGenerating ? 'Creating...' : 'Create Strategy'}
|
||||
</Button>
|
||||
</span>
|
||||
</MuiTooltip>
|
||||
|
||||
<Button
|
||||
variant="contained"
|
||||
startIcon={<SaveIcon />}
|
||||
onClick={handleSaveStrategy}
|
||||
disabled={saving || completionPercentage < 30}
|
||||
>
|
||||
{saving ? 'Saving...' : 'Save Strategy'}
|
||||
</Button>
|
||||
</Box>
|
||||
|
||||
{/* AI Recommendations Modal */}
|
||||
<Dialog
|
||||
open={showAIRecommendations}
|
||||
onClose={() => setShowAIRecommendations(false)}
|
||||
maxWidth="md"
|
||||
fullWidth
|
||||
>
|
||||
<DialogTitle>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
<AutoAwesomeIcon />
|
||||
AI Recommendations & Insights
|
||||
</Box>
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<AIRecommendationsPanel
|
||||
aiGenerating={aiGenerating}
|
||||
onGenerateRecommendations={handleCreateStrategy}
|
||||
/>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={() => setShowAIRecommendations(false)}>
|
||||
Close
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
|
||||
{/* Data Source Transparency Modal */}
|
||||
<Dialog
|
||||
open={showDataSourceTransparency}
|
||||
onClose={() => setShowDataSourceTransparency(false)}
|
||||
maxWidth="md"
|
||||
fullWidth
|
||||
>
|
||||
<DialogTitle>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
<InfoIcon />
|
||||
Data Source Transparency
|
||||
</Box>
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<DataSourceTransparency
|
||||
autoPopulatedFields={autoPopulatedFields}
|
||||
dataSources={dataSources}
|
||||
/>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={() => setShowDataSourceTransparency(false)}>
|
||||
Close
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
|
||||
{/* Tooltip */}
|
||||
{showTooltip && (
|
||||
<EnhancedTooltip
|
||||
fieldId={showTooltip}
|
||||
open={!!showTooltip}
|
||||
onClose={() => setShowTooltip(null)}
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export default EnhancedStrategyBuilder;
|
||||
@@ -55,7 +55,7 @@ import {
|
||||
} from '@mui/icons-material';
|
||||
import { useContentPlanningStore } from '../../../stores/contentPlanningStore';
|
||||
import { contentPlanningApi } from '../../../services/contentPlanningApi';
|
||||
import EnhancedStrategyBuilder from '../components/EnhancedStrategyBuilder';
|
||||
import ContentStrategyBuilder from '../components/ContentStrategyBuilder';
|
||||
|
||||
interface TabPanelProps {
|
||||
children?: React.ReactNode;
|
||||
@@ -429,20 +429,6 @@ const ContentStrategyTab: React.FC = () => {
|
||||
|
||||
return (
|
||||
<Box sx={{ p: 3 }}>
|
||||
<Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', mb: 3 }}>
|
||||
<Typography variant="h4" gutterBottom>
|
||||
Content Strategy Builder
|
||||
</Typography>
|
||||
<Button
|
||||
variant="outlined"
|
||||
startIcon={<RefreshIcon />}
|
||||
onClick={handleRefreshData}
|
||||
disabled={loading}
|
||||
>
|
||||
Refresh Data
|
||||
</Button>
|
||||
</Box>
|
||||
|
||||
{error && (
|
||||
<Alert severity="error" sx={{ mb: 2 }}>
|
||||
{error}
|
||||
@@ -455,13 +441,12 @@ const ContentStrategyTab: React.FC = () => {
|
||||
<Tabs value={tabValue} onChange={handleTabChange} aria-label="strategy builder tabs">
|
||||
<Tab
|
||||
label={
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
<AutoAwesomeIcon />
|
||||
<Box sx={{ display: 'flex', alignItems: 'center' }}>
|
||||
<AutoAwesomeIcon sx={{ mr: 1 }} />
|
||||
Enhanced Strategy Builder
|
||||
</Box>
|
||||
}
|
||||
/>
|
||||
<Tab label="Legacy Strategy Builder" />
|
||||
<Tab label="Strategic Intelligence" icon={<AssessmentIcon />} />
|
||||
<Tab label="Keyword Research" icon={<SearchIcon />} />
|
||||
<Tab label="Performance Analytics" icon={<BarChartIcon />} />
|
||||
@@ -471,479 +456,340 @@ const ContentStrategyTab: React.FC = () => {
|
||||
|
||||
{/* Enhanced Strategy Builder Tab */}
|
||||
<TabPanel value={tabValue} index={0}>
|
||||
<EnhancedStrategyBuilder />
|
||||
</TabPanel>
|
||||
|
||||
{/* Legacy Strategy Builder Tab */}
|
||||
<TabPanel value={tabValue} index={1}>
|
||||
<Grid container spacing={3}>
|
||||
{/* Strategy Overview */}
|
||||
<Grid item xs={12} md={4}>
|
||||
<Paper sx={{ p: 3, mb: 3 }}>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
<BusinessIcon sx={{ mr: 1, verticalAlign: 'middle' }} />
|
||||
Strategy Overview
|
||||
</Typography>
|
||||
<Divider sx={{ mb: 2 }} />
|
||||
|
||||
<TextField
|
||||
fullWidth
|
||||
label="Strategy Name"
|
||||
value={strategyForm.name}
|
||||
onChange={(e) => handleStrategyFormChange('name', e.target.value)}
|
||||
placeholder="Enter strategy name"
|
||||
sx={{ mb: 2 }}
|
||||
/>
|
||||
|
||||
<TextField
|
||||
fullWidth
|
||||
multiline
|
||||
rows={3}
|
||||
label="Strategy Description"
|
||||
value={strategyForm.description}
|
||||
onChange={(e) => handleStrategyFormChange('description', e.target.value)}
|
||||
placeholder="Describe your content strategy"
|
||||
sx={{ mb: 2 }}
|
||||
/>
|
||||
|
||||
<TextField
|
||||
fullWidth
|
||||
label="Industry"
|
||||
value={strategyForm.industry}
|
||||
onChange={(e) => handleStrategyFormChange('industry', e.target.value)}
|
||||
placeholder="e.g., Technology, Healthcare, Finance"
|
||||
sx={{ mb: 2 }}
|
||||
/>
|
||||
|
||||
<Button
|
||||
variant="contained"
|
||||
fullWidth
|
||||
startIcon={<AddIcon />}
|
||||
disabled={loading}
|
||||
onClick={handleCreateStrategy}
|
||||
>
|
||||
{loading ? 'Creating...' : 'Create Strategy'}
|
||||
</Button>
|
||||
</Paper>
|
||||
|
||||
{/* Performance Metrics */}
|
||||
<Paper sx={{ p: 3, mb: 3 }}>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
<AnalyticsIcon sx={{ mr: 1, verticalAlign: 'middle' }} />
|
||||
Performance Metrics
|
||||
</Typography>
|
||||
<Divider sx={{ mb: 2 }} />
|
||||
|
||||
{performanceMetrics ? (
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={6}>
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
Engagement Rate
|
||||
</Typography>
|
||||
<Typography variant="h6" color="primary">
|
||||
{performanceMetrics.engagement || 75.2}%
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
Reach
|
||||
</Typography>
|
||||
<Typography variant="h6" color="primary">
|
||||
{(performanceMetrics.reach || 12500).toLocaleString()}
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
Conversion Rate
|
||||
</Typography>
|
||||
<Typography variant="h6" color="success.main">
|
||||
{performanceMetrics.conversion || 3.8}%
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
ROI
|
||||
</Typography>
|
||||
<Typography variant="h6" color="success.main">
|
||||
${(performanceMetrics.roi || 14200).toLocaleString()}
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
) : (
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
No performance data available
|
||||
</Typography>
|
||||
)}
|
||||
</Paper>
|
||||
</Grid>
|
||||
|
||||
{/* Main Content Area */}
|
||||
<Grid item xs={12} md={8}>
|
||||
<Paper sx={{ width: '100%' }}>
|
||||
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
|
||||
<Tabs value={tabValue} onChange={handleTabChange} aria-label="strategy tabs">
|
||||
<Tab label="Strategic Intelligence" icon={<AssessmentIcon />} />
|
||||
<Tab label="Keyword Research" icon={<SearchIcon />} />
|
||||
<Tab label="Performance Analytics" icon={<BarChartIcon />} />
|
||||
<Tab label="Content Pillars" icon={<PieChartIcon />} />
|
||||
</Tabs>
|
||||
</Box>
|
||||
|
||||
{/* Strategic Intelligence Tab */}
|
||||
<TabPanel value={tabValue} index={2}>
|
||||
{dataLoading.strategicIntelligence ? (
|
||||
<Box sx={{ display: 'flex', justifyContent: 'center', p: 3 }}>
|
||||
<CircularProgress />
|
||||
</Box>
|
||||
) : strategicIntelligence && strategicIntelligence.market_positioning ? (
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12} md={6}>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Market Positioning
|
||||
</Typography>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', mb: 2 }}>
|
||||
<CircularProgress
|
||||
variant="determinate"
|
||||
value={strategicIntelligence.market_positioning.score || 0}
|
||||
size={60}
|
||||
color="primary"
|
||||
/>
|
||||
<Typography variant="h4" sx={{ ml: 2 }}>
|
||||
{strategicIntelligence.market_positioning.score || 0}/100
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
<Typography variant="subtitle2" gutterBottom>
|
||||
Strengths:
|
||||
</Typography>
|
||||
<List dense>
|
||||
{(strategicIntelligence.market_positioning.strengths || []).map((strength: string, index: number) => (
|
||||
<ListItem key={index}>
|
||||
<ListItemIcon>
|
||||
<CheckCircleIcon color="success" />
|
||||
</ListItemIcon>
|
||||
<ListItemText primary={strength} />
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12} md={6}>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Competitive Advantages
|
||||
</Typography>
|
||||
{(strategicIntelligence.competitive_advantages || []).map((advantage: any, index: number) => (
|
||||
<Box key={index} sx={{ mb: 2 }}>
|
||||
<Typography variant="subtitle1">
|
||||
{advantage.advantage}
|
||||
</Typography>
|
||||
<Box sx={{ display: 'flex', gap: 1, mt: 1 }}>
|
||||
<Chip
|
||||
label={advantage.impact}
|
||||
color={advantage.impact === 'High' ? 'success' : 'primary'}
|
||||
size="small"
|
||||
/>
|
||||
<Chip
|
||||
label={advantage.implementation}
|
||||
variant="outlined"
|
||||
size="small"
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
))}
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12}>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Strategic Risks
|
||||
</Typography>
|
||||
{(strategicIntelligence.strategic_risks || []).map((risk: any, index: number) => (
|
||||
<Box key={index} sx={{ mb: 2 }}>
|
||||
<Typography variant="subtitle1">
|
||||
{risk.risk}
|
||||
</Typography>
|
||||
<Box sx={{ display: 'flex', gap: 1, mt: 1 }}>
|
||||
<Chip
|
||||
label={`Probability: ${risk.probability}`}
|
||||
color={risk.probability === 'High' ? 'error' : 'warning'}
|
||||
size="small"
|
||||
/>
|
||||
<Chip
|
||||
label={`Impact: ${risk.impact}`}
|
||||
color={risk.impact === 'High' ? 'error' : 'warning'}
|
||||
size="small"
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
))}
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Grid>
|
||||
</Grid>
|
||||
) : (
|
||||
<Typography variant="body2" color="text.secondary" sx={{ textAlign: 'center', p: 3 }}>
|
||||
No strategic intelligence data available
|
||||
</Typography>
|
||||
)}
|
||||
</TabPanel>
|
||||
|
||||
{/* Keyword Research Tab */}
|
||||
<TabPanel value={tabValue} index={3}>
|
||||
{dataLoading.keywordResearch ? (
|
||||
<Box sx={{ display: 'flex', justifyContent: 'center', p: 3 }}>
|
||||
<CircularProgress />
|
||||
</Box>
|
||||
) : keywordResearch && keywordResearch.trend_analysis ? (
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12} md={6}>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
High Volume Keywords
|
||||
</Typography>
|
||||
<TableContainer>
|
||||
<Table size="small">
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell>Keyword</TableCell>
|
||||
<TableCell>Volume</TableCell>
|
||||
<TableCell>Difficulty</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
{(keywordResearch.trend_analysis.high_volume_keywords || []).map((keyword: any, index: number) => (
|
||||
<TableRow key={index}>
|
||||
<TableCell>{keyword.keyword}</TableCell>
|
||||
<TableCell>{keyword.volume}</TableCell>
|
||||
<TableCell>
|
||||
<Chip
|
||||
label={keyword.difficulty}
|
||||
color={keyword.difficulty === 'Low' ? 'success' : keyword.difficulty === 'Medium' ? 'warning' : 'error'}
|
||||
size="small"
|
||||
/>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12} md={6}>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Trending Keywords
|
||||
</Typography>
|
||||
{(keywordResearch.trend_analysis.trending_keywords || []).map((keyword: any, index: number) => (
|
||||
<Box key={index} sx={{ mb: 2 }}>
|
||||
<Typography variant="subtitle1">
|
||||
{keyword.keyword}
|
||||
</Typography>
|
||||
<Box sx={{ display: 'flex', gap: 1 }}>
|
||||
<Chip
|
||||
label={keyword.growth}
|
||||
color="success"
|
||||
size="small"
|
||||
/>
|
||||
<Chip
|
||||
label={keyword.opportunity}
|
||||
color={keyword.opportunity === 'High' ? 'success' : 'primary'}
|
||||
size="small"
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
))}
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12}>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Keyword Opportunities
|
||||
</Typography>
|
||||
<TableContainer>
|
||||
<Table>
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell>Keyword</TableCell>
|
||||
<TableCell>Search Volume</TableCell>
|
||||
<TableCell>Competition</TableCell>
|
||||
<TableCell>CPC</TableCell>
|
||||
<TableCell>Action</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
{(keywordResearch.opportunities || []).map((opportunity: any, index: number) => (
|
||||
<TableRow key={index}>
|
||||
<TableCell>{opportunity.keyword}</TableCell>
|
||||
<TableCell>{opportunity.search_volume}</TableCell>
|
||||
<TableCell>
|
||||
<Chip
|
||||
label={opportunity.competition}
|
||||
color={opportunity.competition === 'Low' ? 'success' : opportunity.competition === 'Medium' ? 'warning' : 'error'}
|
||||
size="small"
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell>${opportunity.cpc}</TableCell>
|
||||
<TableCell>
|
||||
<Button size="small" variant="outlined">
|
||||
Add to Strategy
|
||||
</Button>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Grid>
|
||||
</Grid>
|
||||
) : (
|
||||
<Typography variant="body2" color="text.secondary" sx={{ textAlign: 'center', p: 3 }}>
|
||||
No keyword research data available
|
||||
</Typography>
|
||||
)}
|
||||
</TabPanel>
|
||||
|
||||
{/* Performance Analytics Tab */}
|
||||
<TabPanel value={tabValue} index={4}>
|
||||
{performanceMetrics ? (
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12} md={6}>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Content Performance by Type
|
||||
</Typography>
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
No content performance data available
|
||||
</Typography>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12} md={6}>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Growth Trends
|
||||
</Typography>
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
No trend data available
|
||||
</Typography>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Grid>
|
||||
</Grid>
|
||||
) : (
|
||||
<Typography variant="body2" color="text.secondary" sx={{ textAlign: 'center', p: 3 }}>
|
||||
No performance analytics data available
|
||||
</Typography>
|
||||
)}
|
||||
</TabPanel>
|
||||
|
||||
{/* Content Pillars Tab */}
|
||||
<TabPanel value={tabValue} index={5}>
|
||||
{dataLoading.pillars ? (
|
||||
<Box sx={{ display: 'flex', justifyContent: 'center', p: 3 }}>
|
||||
<CircularProgress />
|
||||
</Box>
|
||||
) : contentPillars.length > 0 ? (
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Content Pillars Overview
|
||||
</Typography>
|
||||
<Typography variant="body2" color="text.secondary" sx={{ mb: 3 }}>
|
||||
Your content is organized into these strategic pillars to ensure comprehensive coverage of your topics.
|
||||
</Typography>
|
||||
</Grid>
|
||||
|
||||
{contentPillars.map((pillar, index) => (
|
||||
<Grid item xs={12} md={6} key={index}>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
{pillar.name}
|
||||
</Typography>
|
||||
<Box sx={{ display: 'flex', justifyContent: 'space-between', mb: 2 }}>
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
Content Count
|
||||
</Typography>
|
||||
<Typography variant="h6">
|
||||
{pillar.content_count}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Box sx={{ display: 'flex', justifyContent: 'space-between', mb: 2 }}>
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
Avg. Engagement
|
||||
</Typography>
|
||||
<Typography variant="h6">
|
||||
{pillar.avg_engagement}%
|
||||
</Typography>
|
||||
</Box>
|
||||
<Box sx={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
Performance Score
|
||||
</Typography>
|
||||
<Typography variant="h6" color="success.main">
|
||||
{pillar.performance_score}/100
|
||||
</Typography>
|
||||
</Box>
|
||||
</CardContent>
|
||||
<CardActions>
|
||||
<Button size="small">View Content</Button>
|
||||
<Button size="small">Optimize</Button>
|
||||
</CardActions>
|
||||
</Card>
|
||||
</Grid>
|
||||
))}
|
||||
</Grid>
|
||||
) : (
|
||||
<Typography variant="body2" color="text.secondary" sx={{ textAlign: 'center', p: 3 }}>
|
||||
No content pillars data available
|
||||
</Typography>
|
||||
)}
|
||||
</TabPanel>
|
||||
</Paper>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<ContentStrategyBuilder />
|
||||
</TabPanel>
|
||||
|
||||
{/* Strategic Intelligence Tab */}
|
||||
<TabPanel value={tabValue} index={2}>
|
||||
{/* Content moved to Legacy Strategy Builder */}
|
||||
<TabPanel value={tabValue} index={1}>
|
||||
{dataLoading.strategicIntelligence ? (
|
||||
<Box sx={{ display: 'flex', justifyContent: 'center', p: 3 }}>
|
||||
<CircularProgress />
|
||||
</Box>
|
||||
) : strategicIntelligence && strategicIntelligence.market_positioning ? (
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12} md={6}>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Market Positioning
|
||||
</Typography>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', mb: 2 }}>
|
||||
<CircularProgress
|
||||
variant="determinate"
|
||||
value={strategicIntelligence.market_positioning.score || 0}
|
||||
size={60}
|
||||
color="primary"
|
||||
/>
|
||||
<Typography variant="h4" sx={{ ml: 2 }}>
|
||||
{strategicIntelligence.market_positioning.score || 0}/100
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
<Typography variant="subtitle2" gutterBottom>
|
||||
Strengths:
|
||||
</Typography>
|
||||
<List dense>
|
||||
{(strategicIntelligence.market_positioning.strengths || []).map((strength: string, index: number) => (
|
||||
<ListItem key={index}>
|
||||
<ListItemIcon>
|
||||
<CheckCircleIcon color="success" />
|
||||
</ListItemIcon>
|
||||
<ListItemText primary={strength} />
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12} md={6}>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Competitive Advantages
|
||||
</Typography>
|
||||
{(strategicIntelligence.competitive_advantages || []).map((advantage: any, index: number) => (
|
||||
<Box key={index} sx={{ mb: 2 }}>
|
||||
<Typography variant="subtitle1">
|
||||
{advantage.advantage}
|
||||
</Typography>
|
||||
<Box sx={{ display: 'flex', gap: 1, mt: 1 }}>
|
||||
<Chip
|
||||
label={advantage.impact}
|
||||
color={advantage.impact === 'High' ? 'success' : 'primary'}
|
||||
size="small"
|
||||
/>
|
||||
<Chip
|
||||
label={advantage.implementation}
|
||||
variant="outlined"
|
||||
size="small"
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
))}
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12}>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Strategic Risks
|
||||
</Typography>
|
||||
{(strategicIntelligence.strategic_risks || []).map((risk: any, index: number) => (
|
||||
<Box key={index} sx={{ mb: 2 }}>
|
||||
<Typography variant="subtitle1">
|
||||
{risk.risk}
|
||||
</Typography>
|
||||
<Box sx={{ display: 'flex', gap: 1, mt: 1 }}>
|
||||
<Chip
|
||||
label={`Probability: ${risk.probability}`}
|
||||
color={risk.probability === 'High' ? 'error' : 'warning'}
|
||||
size="small"
|
||||
/>
|
||||
<Chip
|
||||
label={`Impact: ${risk.impact}`}
|
||||
color={risk.impact === 'High' ? 'error' : 'warning'}
|
||||
size="small"
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
))}
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Grid>
|
||||
</Grid>
|
||||
) : (
|
||||
<Typography variant="body2" color="text.secondary" sx={{ textAlign: 'center', p: 3 }}>
|
||||
No strategic intelligence data available
|
||||
</Typography>
|
||||
)}
|
||||
</TabPanel>
|
||||
|
||||
{/* Keyword Research Tab */}
|
||||
<TabPanel value={tabValue} index={3}>
|
||||
{/* Content moved to Legacy Strategy Builder */}
|
||||
<TabPanel value={tabValue} index={2}>
|
||||
{dataLoading.keywordResearch ? (
|
||||
<Box sx={{ display: 'flex', justifyContent: 'center', p: 3 }}>
|
||||
<CircularProgress />
|
||||
</Box>
|
||||
) : keywordResearch && keywordResearch.trend_analysis ? (
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12} md={6}>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
High Volume Keywords
|
||||
</Typography>
|
||||
<TableContainer>
|
||||
<Table size="small">
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell>Keyword</TableCell>
|
||||
<TableCell>Volume</TableCell>
|
||||
<TableCell>Difficulty</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
{(keywordResearch.trend_analysis.high_volume_keywords || []).map((keyword: any, index: number) => (
|
||||
<TableRow key={index}>
|
||||
<TableCell>{keyword.keyword}</TableCell>
|
||||
<TableCell>{keyword.volume}</TableCell>
|
||||
<TableCell>
|
||||
<Chip
|
||||
label={keyword.difficulty}
|
||||
color={keyword.difficulty === 'Low' ? 'success' : keyword.difficulty === 'Medium' ? 'warning' : 'error'}
|
||||
size="small"
|
||||
/>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12} md={6}>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Trending Keywords
|
||||
</Typography>
|
||||
{(keywordResearch.trend_analysis.trending_keywords || []).map((keyword: any, index: number) => (
|
||||
<Box key={index} sx={{ mb: 2 }}>
|
||||
<Typography variant="subtitle1">
|
||||
{keyword.keyword}
|
||||
</Typography>
|
||||
<Box sx={{ display: 'flex', gap: 1 }}>
|
||||
<Chip
|
||||
label={keyword.growth}
|
||||
color="success"
|
||||
size="small"
|
||||
/>
|
||||
<Chip
|
||||
label={keyword.opportunity}
|
||||
color={keyword.opportunity === 'High' ? 'success' : 'primary'}
|
||||
size="small"
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
))}
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12}>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Keyword Opportunities
|
||||
</Typography>
|
||||
<TableContainer>
|
||||
<Table>
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell>Keyword</TableCell>
|
||||
<TableCell>Search Volume</TableCell>
|
||||
<TableCell>Competition</TableCell>
|
||||
<TableCell>CPC</TableCell>
|
||||
<TableCell>Action</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
{(keywordResearch.opportunities || []).map((opportunity: any, index: number) => (
|
||||
<TableRow key={index}>
|
||||
<TableCell>{opportunity.keyword}</TableCell>
|
||||
<TableCell>{opportunity.search_volume}</TableCell>
|
||||
<TableCell>
|
||||
<Chip
|
||||
label={opportunity.competition}
|
||||
color={opportunity.competition === 'Low' ? 'success' : opportunity.competition === 'Medium' ? 'warning' : 'error'}
|
||||
size="small"
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell>${opportunity.cpc}</TableCell>
|
||||
<TableCell>
|
||||
<Button size="small" variant="outlined">
|
||||
Add to Strategy
|
||||
</Button>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Grid>
|
||||
</Grid>
|
||||
) : (
|
||||
<Typography variant="body2" color="text.secondary" sx={{ textAlign: 'center', p: 3 }}>
|
||||
No keyword research data available
|
||||
</Typography>
|
||||
)}
|
||||
</TabPanel>
|
||||
|
||||
{/* Performance Analytics Tab */}
|
||||
<TabPanel value={tabValue} index={4}>
|
||||
{/* Content moved to Legacy Strategy Builder */}
|
||||
<TabPanel value={tabValue} index={3}>
|
||||
{performanceMetrics ? (
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12} md={6}>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Content Performance by Type
|
||||
</Typography>
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
No content performance data available
|
||||
</Typography>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12} md={6}>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Growth Trends
|
||||
</Typography>
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
No trend data available
|
||||
</Typography>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Grid>
|
||||
</Grid>
|
||||
) : (
|
||||
<Typography variant="body2" color="text.secondary" sx={{ textAlign: 'center', p: 3 }}>
|
||||
No performance analytics data available
|
||||
</Typography>
|
||||
)}
|
||||
</TabPanel>
|
||||
|
||||
{/* Content Pillars Tab */}
|
||||
<TabPanel value={tabValue} index={5}>
|
||||
{/* Content moved to Legacy Strategy Builder */}
|
||||
<TabPanel value={tabValue} index={4}>
|
||||
{dataLoading.pillars ? (
|
||||
<Box sx={{ display: 'flex', justifyContent: 'center', p: 3 }}>
|
||||
<CircularProgress />
|
||||
</Box>
|
||||
) : contentPillars.length > 0 ? (
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Content Pillars Overview
|
||||
</Typography>
|
||||
<Typography variant="body2" color="text.secondary" sx={{ mb: 3 }}>
|
||||
Your content is organized into these strategic pillars to ensure comprehensive coverage of your topics.
|
||||
</Typography>
|
||||
</Grid>
|
||||
|
||||
{contentPillars.map((pillar, index) => (
|
||||
<Grid item xs={12} md={6} key={index}>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
{pillar.name}
|
||||
</Typography>
|
||||
<Box sx={{ display: 'flex', justifyContent: 'space-between', mb: 2 }}>
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
Content Count
|
||||
</Typography>
|
||||
<Typography variant="h6">
|
||||
{pillar.content_count}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Box sx={{ display: 'flex', justifyContent: 'space-between', mb: 2 }}>
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
Avg. Engagement
|
||||
</Typography>
|
||||
<Typography variant="h6">
|
||||
{pillar.avg_engagement}%
|
||||
</Typography>
|
||||
</Box>
|
||||
<Box sx={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||
<Typography variant="body2" color="text.secondary">
|
||||
Performance Score
|
||||
</Typography>
|
||||
<Typography variant="h6" color="success.main">
|
||||
{pillar.performance_score}/100
|
||||
</Typography>
|
||||
</Box>
|
||||
</CardContent>
|
||||
<CardActions>
|
||||
<Button size="small">View Content</Button>
|
||||
<Button size="small">Optimize</Button>
|
||||
</CardActions>
|
||||
</Card>
|
||||
</Grid>
|
||||
))}
|
||||
</Grid>
|
||||
) : (
|
||||
<Typography variant="body2" color="text.secondary" sx={{ textAlign: 'center', p: 3 }}>
|
||||
No content pillars data available
|
||||
</Typography>
|
||||
)}
|
||||
</TabPanel>
|
||||
</Paper>
|
||||
</Box>
|
||||
|
||||
@@ -918,11 +918,33 @@ export const useEnhancedStrategyStore = create<EnhancedStrategyStore>((set, get)
|
||||
const requiredFields = STRATEGIC_INPUT_FIELDS.filter(field => field.required);
|
||||
const filledRequiredFields = requiredFields.filter(field => {
|
||||
const value = formData[field.id];
|
||||
const isValid = value &&
|
||||
(typeof value === 'string' ? value.trim() !== '' : true) &&
|
||||
(!Array.isArray(value) || value.length > 0);
|
||||
|
||||
console.log(`📊 Field ${field.id}: ${isValid ? '✅' : '❌'} (${value})`);
|
||||
// Enhanced validation logic for different field types
|
||||
let isValid = false;
|
||||
|
||||
if (value) {
|
||||
if (field.type === 'multiselect') {
|
||||
// For multiselect, check if it's an array with at least one item
|
||||
isValid = Array.isArray(value) && value.length > 0;
|
||||
} else if (field.type === 'select') {
|
||||
// For select, check if it's a non-empty string
|
||||
isValid = typeof value === 'string' && value.trim() !== '';
|
||||
} else if (typeof value === 'string') {
|
||||
// For text fields, check if it's not empty
|
||||
isValid = value.trim() !== '';
|
||||
} else if (typeof value === 'number') {
|
||||
// For number fields, check if it's not null/undefined
|
||||
isValid = value !== null && value !== undefined;
|
||||
} else if (Array.isArray(value)) {
|
||||
// For arrays (json fields), check if it has items
|
||||
isValid = value.length > 0;
|
||||
} else {
|
||||
// For other types, just check if it exists
|
||||
isValid = true;
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`📊 Field ${field.id}: ${isValid ? '✅' : '❌'} (${value}) [Type: ${field.type}]`);
|
||||
return isValid;
|
||||
});
|
||||
|
||||
@@ -940,19 +962,57 @@ export const useEnhancedStrategyStore = create<EnhancedStrategyStore>((set, get)
|
||||
|
||||
categories.forEach(category => {
|
||||
const categoryFields = STRATEGIC_INPUT_FIELDS.filter(field => field.category === category);
|
||||
const filledFields = categoryFields.filter(field =>
|
||||
formData[field.id] &&
|
||||
(typeof formData[field.id] === 'string' ? formData[field.id].trim() !== '' : true)
|
||||
);
|
||||
const filledFields = categoryFields.filter(field => {
|
||||
const value = formData[field.id];
|
||||
|
||||
if (!value) return false;
|
||||
|
||||
// Enhanced validation logic for different field types
|
||||
if (field.type === 'multiselect') {
|
||||
// For multiselect, check if it's an array with at least one item
|
||||
return Array.isArray(value) && value.length > 0;
|
||||
} else if (field.type === 'select') {
|
||||
// For select, check if it's a non-empty string
|
||||
return typeof value === 'string' && value.trim() !== '';
|
||||
} else if (typeof value === 'string') {
|
||||
// For text fields, check if it's not empty
|
||||
return value.trim() !== '';
|
||||
} else if (typeof value === 'number') {
|
||||
// For number fields, check if it's not null/undefined
|
||||
return value !== null && value !== undefined;
|
||||
} else if (Array.isArray(value)) {
|
||||
// For arrays (json fields), check if it has items
|
||||
return value.length > 0;
|
||||
} else {
|
||||
// For other types, just check if it exists
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
category_completion[category] = (filledFields.length / categoryFields.length) * 100;
|
||||
});
|
||||
|
||||
const total_fields = STRATEGIC_INPUT_FIELDS.length;
|
||||
const filled_fields = STRATEGIC_INPUT_FIELDS.filter(field =>
|
||||
formData[field.id] &&
|
||||
(typeof formData[field.id] === 'string' ? formData[field.id].trim() !== '' : true)
|
||||
).length;
|
||||
const filled_fields = STRATEGIC_INPUT_FIELDS.filter(field => {
|
||||
const value = formData[field.id];
|
||||
|
||||
if (!value) return false;
|
||||
|
||||
// Enhanced validation logic for different field types
|
||||
if (field.type === 'multiselect') {
|
||||
return Array.isArray(value) && value.length > 0;
|
||||
} else if (field.type === 'select') {
|
||||
return typeof value === 'string' && value.trim() !== '';
|
||||
} else if (typeof value === 'string') {
|
||||
return value.trim() !== '';
|
||||
} else if (typeof value === 'number') {
|
||||
return value !== null && value !== undefined;
|
||||
} else if (Array.isArray(value)) {
|
||||
return value.length > 0;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}).length;
|
||||
|
||||
return {
|
||||
total_fields,
|
||||
|
||||
Reference in new issue
Block a user