Compare commits
51
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3660290f1b | ||
|
|
8d7d0a74a6 | ||
|
|
b18dd7aa4d | ||
|
|
7f1e2b83a9 | ||
|
|
1d855fd14c | ||
|
|
0ea14da748 | ||
|
|
f3195628d2 | ||
|
|
9910d0146c | ||
|
|
9697c40ed2 | ||
|
|
bf5fc05a25 | ||
|
|
d3502fd421 | ||
|
|
f8ae482a16 | ||
|
|
8a60d69467 | ||
|
|
0a055a605c | ||
|
|
a155a98767 | ||
|
|
cf27da30b4 | ||
|
|
8df5233fee | ||
|
|
5796cce9c0 | ||
|
|
310fde31d6 | ||
|
|
324c78405a | ||
|
|
00ea49b7ed | ||
|
|
82dcda0038 | ||
|
|
bdd52ed992 | ||
|
|
044fd21b2d | ||
|
|
29cee13da7 | ||
|
|
6675b5301f | ||
|
|
2b975a09eb | ||
|
|
b1c3dd49e9 | ||
|
|
dd1f873a6e | ||
|
|
1daf6b0eb2 | ||
|
|
8734d3388d | ||
|
|
f0d9106860 | ||
|
|
5407812889 | ||
|
|
faaca0f4fb | ||
|
|
d7cb0167ec | ||
|
|
e7814742e5 | ||
|
|
7c3c0b4508 | ||
|
|
5b6fab8ef4 | ||
|
|
eceea6a5a4 | ||
|
|
a7c1d1ec76 | ||
|
|
eb55383de5 | ||
|
|
3f3f8bb159 | ||
|
|
7aedf07203 | ||
|
|
65ea09ffd5 | ||
|
|
388351e6d4 | ||
|
|
fa4864e9ef | ||
|
|
1d868627e4 | ||
|
|
8086e28908 | ||
|
|
dc3d128b22 | ||
|
|
937ef7a576 | ||
|
|
9fe03a66cb |
No files matched your search
+10
-1
@@ -4,7 +4,15 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||||
<title>CASTAD</title>
|
<title>ADO2</title>
|
||||||
|
<!-- ① 페이지 설명 -->
|
||||||
|
<meta name="description" content="ADO2는 ㈜에이아이오투오의 AI 기반 마케팅 자동화 플랫폼입니다. 콘텐츠 제작부터 채널 배포까지 자동으로 처리합니다." />
|
||||||
|
<!-- ② Open Graph 제목 -->
|
||||||
|
<meta property="og:title" content="ADO2 - AI 마케팅 자동화 플랫폼" />
|
||||||
|
<!-- ③ Open Graph 설명 -->
|
||||||
|
<meta property="og:description" content="ADO2는 ㈜에이아이오투오의 AI 기반 마케팅 자동화 플랫폼입니다. 콘텐츠 제작부터 채널 배포까지 자동으로 처리합니다." />
|
||||||
|
<meta property="og:url" content="https://demo.castad.net/" />
|
||||||
|
<meta property="og:type" content="website" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/favicon_32.svg" sizes="32x32">
|
<link rel="icon" type="image/svg+xml" href="/favicon_32.svg" sizes="32x32">
|
||||||
<link rel="icon" type="image/svg+xml" href="/favicon_48.svg" sizes="48x48">
|
<link rel="icon" type="image/svg+xml" href="/favicon_48.svg" sizes="48x48">
|
||||||
<script src="https://cdn.tailwindcss.com"></script>
|
<script src="https://cdn.tailwindcss.com"></script>
|
||||||
@@ -28,6 +36,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<script src="https://t1.kakaocdn.net/kakao_js_sdk/2.7.4/kakao.min.js" crossorigin="anonymous"></script>
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&family=Playfair+Display:ital,wght@0,700;1,700&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&family=Playfair+Display:ital,wght@0,700;1,700&display=swap" rel="stylesheet">
|
||||||
|
|||||||
Generated
+6
-17
@@ -12,7 +12,7 @@
|
|||||||
"react": "^19.2.3",
|
"react": "^19.2.3",
|
||||||
"react-dom": "^19.2.3",
|
"react-dom": "^19.2.3",
|
||||||
"react-i18next": "^16.5.4",
|
"react-i18next": "^16.5.4",
|
||||||
"recharts": "^3.7.0"
|
"recharts": "^3.8.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^22.14.0",
|
"@types/node": "^22.14.0",
|
||||||
@@ -52,7 +52,6 @@
|
|||||||
"integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==",
|
"integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peer": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/code-frame": "^7.27.1",
|
"@babel/code-frame": "^7.27.1",
|
||||||
"@babel/generator": "^7.28.5",
|
"@babel/generator": "^7.28.5",
|
||||||
@@ -1289,7 +1288,6 @@
|
|||||||
"integrity": "sha512-1N9SBnWYOJTrNZCdh/yJE+t910Y128BoyY+zBLWhL3r0TYzlTmFdXrPwHL9DyFZmlEXNQQolTZh3KHV31QDhyA==",
|
"integrity": "sha512-1N9SBnWYOJTrNZCdh/yJE+t910Y128BoyY+zBLWhL3r0TYzlTmFdXrPwHL9DyFZmlEXNQQolTZh3KHV31QDhyA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peer": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"undici-types": "~6.21.0"
|
"undici-types": "~6.21.0"
|
||||||
}
|
}
|
||||||
@@ -1351,7 +1349,6 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peer": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"baseline-browser-mapping": "^2.9.0",
|
"baseline-browser-mapping": "^2.9.0",
|
||||||
"caniuse-lite": "^1.0.30001759",
|
"caniuse-lite": "^1.0.30001759",
|
||||||
@@ -1694,7 +1691,6 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peer": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.28.4"
|
"@babel/runtime": "^7.28.4"
|
||||||
},
|
},
|
||||||
@@ -1815,7 +1811,6 @@
|
|||||||
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
|
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peer": true,
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
},
|
},
|
||||||
@@ -1857,7 +1852,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/react/-/react-19.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/react/-/react-19.2.3.tgz",
|
||||||
"integrity": "sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==",
|
"integrity": "sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peer": true,
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
@@ -1867,7 +1861,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.3.tgz",
|
||||||
"integrity": "sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==",
|
"integrity": "sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peer": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"scheduler": "^0.27.0"
|
"scheduler": "^0.27.0"
|
||||||
},
|
},
|
||||||
@@ -1914,7 +1907,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.2.0.tgz",
|
||||||
"integrity": "sha512-ROY9fvHhwOD9ySfrF0wmvu//bKCQ6AeZZq1nJNtbDC+kk5DuSuNX/n6YWYF/SYy7bSba4D4FSz8DJeKY/S/r+g==",
|
"integrity": "sha512-ROY9fvHhwOD9ySfrF0wmvu//bKCQ6AeZZq1nJNtbDC+kk5DuSuNX/n6YWYF/SYy7bSba4D4FSz8DJeKY/S/r+g==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peer": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/use-sync-external-store": "^0.0.6",
|
"@types/use-sync-external-store": "^0.0.6",
|
||||||
"use-sync-external-store": "^1.4.0"
|
"use-sync-external-store": "^1.4.0"
|
||||||
@@ -1944,15 +1936,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/recharts": {
|
"node_modules/recharts": {
|
||||||
"version": "3.7.0",
|
"version": "3.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/recharts/-/recharts-3.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/recharts/-/recharts-3.8.0.tgz",
|
||||||
"integrity": "sha512-l2VCsy3XXeraxIID9fx23eCb6iCBsxUQDnE8tWm6DFdszVAO7WVY/ChAD9wVit01y6B2PMupYiMmQwhgPHc9Ew==",
|
"integrity": "sha512-Z/m38DX3L73ExO4Tpc9/iZWHmHnlzWG4njQbxsF5aSjwqmHNDDIm0rdEBArkwsBvR8U6EirlEHiQNYWCVh9sGQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"www"
|
"www"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@reduxjs/toolkit": "1.x.x || 2.x.x",
|
"@reduxjs/toolkit": "^1.9.0 || 2.x.x",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"decimal.js-light": "^2.5.1",
|
"decimal.js-light": "^2.5.1",
|
||||||
"es-toolkit": "^1.39.3",
|
"es-toolkit": "^1.39.3",
|
||||||
@@ -1977,8 +1969,7 @@
|
|||||||
"version": "5.0.1",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz",
|
||||||
"integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==",
|
"integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==",
|
||||||
"license": "MIT",
|
"license": "MIT"
|
||||||
"peer": true
|
|
||||||
},
|
},
|
||||||
"node_modules/redux-thunk": {
|
"node_modules/redux-thunk": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
@@ -2092,7 +2083,6 @@
|
|||||||
"integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
|
"integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
|
||||||
"devOptional": true,
|
"devOptional": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"peer": true,
|
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
"tsserver": "bin/tsserver"
|
"tsserver": "bin/tsserver"
|
||||||
@@ -2176,7 +2166,6 @@
|
|||||||
"integrity": "sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==",
|
"integrity": "sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peer": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"esbuild": "^0.25.0",
|
"esbuild": "^0.25.0",
|
||||||
"fdir": "^6.4.4",
|
"fdir": "^6.4.4",
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@
|
|||||||
"react": "^19.2.3",
|
"react": "^19.2.3",
|
||||||
"react-dom": "^19.2.3",
|
"react-dom": "^19.2.3",
|
||||||
"react-i18next": "^16.5.4",
|
"react-i18next": "^16.5.4",
|
||||||
"recharts": "^3.7.0"
|
"recharts": "^3.8.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^22.14.0",
|
"@types/node": "^22.14.0",
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 660.69 145.69">
|
||||||
|
<!-- Generator: Adobe Illustrator 30.5.1, SVG Export Plug-In . SVG Version: 2.1.4 Build 3) -->
|
||||||
|
<defs>
|
||||||
|
<style>
|
||||||
|
.st0 {
|
||||||
|
fill: #fff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</defs>
|
||||||
|
<g>
|
||||||
|
<g>
|
||||||
|
<path class="st0" d="M53.46,93.51l11.28-12.51h64.08l-31.22-63.81L32.69,93.51H15.09L90.17,5.91c2.48-2.89,6.19-5.64,10.73-5.64s7.29,2.48,8.8,5.64l43.45,87.6H53.46Z"/>
|
||||||
|
<path class="st0" d="M162.65,93.51l10.04-57.34h14.99l-7.84,44.83h42.22c23.38,0,43.18-16.78,43.18-38.5,0-16.64-12.51-28.33-31.35-28.33h-57.21l11.83-12.65h47.58c26.68,0,44.14,15.68,44.14,38.5,0,29.84-27.5,53.49-60.37,53.49h-57.21Z"/>
|
||||||
|
<path class="st0" d="M343.75,95.02c-36.17,0-54.45-12.1-54.45-38.37,0-38.09,23.24-56.65,71.23-56.65,36.17,0,54.46,11.96,54.46,38.23,0,38.09-23.1,56.79-71.23,56.79ZM358.33,12.51c-39.6,0-53.9,12.24-53.9,42.63,0,19.94,13.2,27.36,41.53,27.36,39.47,0,53.91-12.38,53.91-42.77,0-19.94-13.2-27.23-41.53-27.23Z"/>
|
||||||
|
<path class="st0" d="M417.47,93.51l4.81-27.23c2.89-16.5,15.68-24.48,36.58-24.48h40.15c16.91,0,23.79-5.78,23.79-15.68,0-9.08-9.08-11.96-26.4-11.96h-59.54l11.96-12.65h55.97c23.51,0,32.73,8.66,32.73,21.59,0,16.91-11,29.7-39.05,29.7h-40.15c-12.65,0-19.8,3.99-21.59,13.34l-2.47,14.85h94.75l-11.83,12.51h-99.7Z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path class="st0" d="M542.35,92.89c-2.38,0-4.15-1.38-4.15-3.61,0-3.07,2.69-4.84,5.68-4.84,2.46,0,4.3,1.31,4.3,3.53,0,3.07-2.69,4.92-5.84,4.92Z"/>
|
||||||
|
<path class="st0" d="M577.37,92.2l6.3-6.99h35.79l-17.43-35.63-36.25,42.62h-9.83l41.93-48.92c1.38-1.61,3.46-3.15,5.99-3.15s4.07,1.38,4.92,3.15l24.27,48.92h-55.68Z"/>
|
||||||
|
<path class="st0" d="M643.26,92.2l9.14-51.38h8.29l-9.14,51.38h-8.29Z"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path class="st0" d="M.43,125.73c1.34-5.83,5.61-10.49,11.96-10.49,5.4,0,8.98,3.3,9.1,8.33,0,.17-.08.25-.23.25h-2.56c-.15,0-.23-.08-.23-.23-.17-3.74-2.48-5.9-6.18-5.9-4.69,0-7.56,3.67-8.65,8.31-1.31,5.71.33,11.09,6.32,11.09,3.43,0,6.17-1.81,7.52-6.23.03-.13.13-.2.27-.2h2.61c.17,0,.25.12.2.3-1.66,5.75-5.58,8.58-10.76,8.58-8.23,0-10.96-6.85-9.37-13.81Z"/>
|
||||||
|
<path class="st0" d="M25.26,129.28c1.02-4.34,4.26-7.77,9.1-7.77,5.75,0,8.31,4.74,7.04,10.19-1.02,4.34-4.24,7.77-9.08,7.77-5.76,0-8.33-4.74-7.05-10.19ZM38.31,131.48c.97-4.12-.25-7.86-4.07-7.86-3.17,0-5.13,2.61-5.9,5.88-.97,4.12.25,7.86,4.07,7.86,3.17,0,5.13-2.61,5.9-5.88Z"/>
|
||||||
|
<path class="st0" d="M44.55,138.85l1.83-7.57,2.08-9.2c.03-.15.13-.22.27-.22h2.5c.17,0,.25.1.22.27l-.7,2.76c1.24-1.86,3.43-3.43,6.01-3.43,3.38,0,5.7,2.48,4.66,7.04l-.74,3.25-1.61,7.15c-.03.15-.13.22-.27.22h-2.63c-.17,0-.25-.1-.2-.27l1.64-6.82.74-3.3c.74-3.3-.5-4.94-2.8-4.94-2.63,0-4.49,2.43-5.63,5.19l-.72,3.08-1.51,6.84c-.03.15-.13.22-.27.22h-2.66c-.15,0-.25-.1-.2-.27Z"/>
|
||||||
|
<path class="st0" d="M66.61,134.4l2.4-10.29h-1.96c-.17,0-.25-.1-.22-.29l.4-1.74c.03-.15.13-.22.27-.22h2.01l.89-4.1c.03-.15.13-.22.27-.22h2.66c.17,0,.25.1.22.27l-.99,4.05h3.97c.17,0,.25.1.22.27l-.42,1.76c-.03.13-.13.22-.27.22h-4.04l-2.35,10.22c-.45,1.98.08,2.78,1.56,2.78.59,0,1.26-.08,1.78-.2.18-.05.28.05.23.24l-.37,1.62c-.03.13-.1.2-.2.23-.75.22-1.71.38-2.58.38-2.35,0-4.37-1.26-3.48-4.99Z"/>
|
||||||
|
<path class="st0" d="M78.34,129.22c.92-4.04,3.95-7.71,8.98-7.71s7.96,3.69,6.8,9.15c-.02.13-.12.2-.25.2h-12.78c-.37,3.18.57,6.5,4.51,6.5,2.35,0,4.21-1.12,5.09-3.94.05-.13.15-.2.28-.2h2.41c.17,0,.25.12.2.29-1.17,3.99-4.07,5.96-8.01,5.96-6.68,0-8.38-5.39-7.24-10.25ZM91.3,128.82c.47-3-1.14-5.21-4.15-5.21-3.17,0-4.98,2.43-5.71,5.21h9.87Z"/>
|
||||||
|
<path class="st0" d="M97.15,138.85l1.83-7.57,2.08-9.2c.03-.15.13-.22.27-.22h2.5c.17,0,.25.1.22.27l-.7,2.76c1.24-1.86,3.43-3.43,6.01-3.43,3.38,0,5.7,2.48,4.66,7.04l-.74,3.25-1.61,7.15c-.03.15-.13.22-.27.22h-2.63c-.17,0-.25-.1-.2-.27l1.64-6.82.74-3.3c.74-3.3-.5-4.94-2.8-4.94-2.63,0-4.49,2.43-5.63,5.19l-.72,3.08-1.51,6.84c-.03.15-.13.22-.27.22h-2.66c-.15,0-.25-.1-.2-.27Z"/>
|
||||||
|
<path class="st0" d="M119.21,134.4l2.4-10.29h-1.96c-.17,0-.25-.1-.22-.29l.4-1.74c.03-.15.13-.22.27-.22h2.01l.89-4.1c.03-.15.13-.22.27-.22h2.66c.17,0,.25.1.22.27l-.99,4.05h3.97c.17,0,.25.1.22.27l-.42,1.76c-.03.13-.13.22-.27.22h-4.04l-2.35,10.22c-.45,1.98.08,2.78,1.56,2.78.59,0,1.26-.08,1.78-.2.18-.05.28.05.23.24l-.37,1.62c-.03.13-.1.2-.2.23-.75.22-1.71.38-2.58.38-2.35,0-4.37-1.26-3.48-4.99Z"/>
|
||||||
|
<path class="st0" d="M138.69,138.85l2.7-11.23,2.63-11.75c.03-.15.13-.22.27-.22h3.48c.15,0,.23.08.25.22l2.25,14.38.77,4.94,3.05-5.01,8.73-14.36c.07-.12.17-.17.3-.17h3.84c.15,0,.25.1.2.27l-2.76,11.69-2.53,11.28c-.03.15-.13.22-.27.22h-2.66c-.17,0-.25-.1-.22-.27l2.13-9.05,2.4-9.94-11.64,19.08c-.07.12-.17.17-.29.17h-2.11c-.15,0-.23-.08-.27-.22l-3.03-19.33-2.23,10.24-2.08,9.1c-.03.15-.13.22-.27.22h-2.41c-.17,0-.25-.1-.22-.27Z"/>
|
||||||
|
<path class="st0" d="M168.95,129.55c1.01-4.36,3.89-7.96,8.36-7.96,2.85,0,4.49,1.47,5.21,3.55l.67-3.07c.03-.15.13-.22.27-.22h2.6c.17,0,.25.1.22.27l-1.96,8.23-1.91,8.54c-.03.15-.13.22-.27.22h-2.51c-.15,0-.25-.1-.2-.27l.54-2.13c-1.36,1.59-3.15,2.65-5.34,2.65-4.99,0-6.87-4.66-5.66-9.82ZM181.38,130.98c.85-3.72.13-7.27-3.57-7.27-3.2,0-5.04,2.71-5.81,5.95-.92,4,.03,7.61,3.52,7.61,3,0,5.04-2.78,5.86-6.28Z"/>
|
||||||
|
<path class="st0" d="M187.85,138.85l2.04-8.54,1.83-8.23c.03-.15.13-.22.27-.22h2.56c.15,0,.25.1.2.27l-.79,3.07c1.74-2.29,4.07-3.5,6.42-3.5.37,0,.72.03,1.02.12.15.03.2.13.17.28l-.44,1.88c-.03.15-.13.2-.28.18-.27-.07-.59-.08-.9-.08-2.76,0-5.55,1.93-6.89,5.38l-2.14,9.45c-.03.15-.13.22-.27.22h-2.58c-.17,0-.27-.1-.22-.27Z"/>
|
||||||
|
<path class="st0" d="M202.32,138.87l2.71-11.38,2.58-11.61c.03-.15.13-.22.27-.22h2.58c.17,0,.27.1.22.27l-3.08,12.9,7.81-6.85c.1-.07.18-.12.3-.12h3.32c.22,0,.28.15.12.3l-7.04,5.93,3.94,10.74c.05.18-.02.29-.2.29h-2.68c-.13,0-.22-.05-.27-.2l-.8-2.51-2.33-6.4-2.98,2.61-1.39,6.3c-.03.15-.13.22-.27.22h-2.58c-.17,0-.25-.1-.22-.27Z"/>
|
||||||
|
<path class="st0" d="M219.82,129.22c.92-4.04,3.95-7.71,8.98-7.71s7.96,3.69,6.8,9.15c-.02.13-.12.2-.25.2h-12.78c-.37,3.18.57,6.5,4.51,6.5,2.35,0,4.21-1.12,5.09-3.94.05-.13.15-.2.28-.2h2.41c.17,0,.25.12.2.29-1.17,3.99-4.07,5.96-8.01,5.96-6.68,0-8.38-5.39-7.24-10.25ZM232.79,128.82c.47-3-1.14-5.21-4.15-5.21-3.17,0-4.98,2.43-5.71,5.21h9.87Z"/>
|
||||||
|
<path class="st0" d="M240.64,134.4l2.4-10.29h-1.96c-.17,0-.25-.1-.22-.29l.4-1.74c.03-.15.13-.22.27-.22h2.01l.89-4.1c.03-.15.13-.22.27-.22h2.66c.17,0,.25.1.22.27l-.99,4.05h3.97c.17,0,.25.1.22.27l-.42,1.76c-.03.13-.13.22-.27.22h-4.04l-2.35,10.22c-.45,1.98.08,2.78,1.56,2.78.59,0,1.26-.08,1.78-.2.18-.05.28.05.23.24l-.37,1.62c-.03.13-.1.2-.2.23-.75.22-1.71.38-2.58.38-2.35,0-4.37-1.26-3.48-4.99Z"/>
|
||||||
|
<path class="st0" d="M251.75,138.85l2.04-8.65,1.83-8.13c.03-.15.13-.22.27-.22h2.65c.17,0,.25.1.22.27l-1.94,8.06-1.94,8.71c-.02.15-.13.22-.27.22h-2.63c-.17,0-.25-.1-.22-.27ZM256.2,119.55l.65-2.73c.03-.15.13-.22.27-.22h2.61c.17,0,.25.1.22.27l-.64,2.75c-.03.13-.13.22-.27.22h-2.63c-.17,0-.25-.12-.22-.28Z"/>
|
||||||
|
<path class="st0" d="M260.47,138.85l1.83-7.57,2.08-9.2c.03-.15.13-.22.27-.22h2.5c.17,0,.25.1.22.27l-.7,2.76c1.24-1.86,3.43-3.43,6.01-3.43,3.38,0,5.7,2.48,4.66,7.04l-.74,3.25-1.61,7.15c-.03.15-.13.22-.27.22h-2.63c-.17,0-.25-.1-.2-.27l1.64-6.82.74-3.3c.74-3.3-.5-4.94-2.8-4.94-2.63,0-4.49,2.43-5.63,5.19l-.72,3.08-1.51,6.84c-.03.15-.13.22-.27.22h-2.66c-.15,0-.25-.1-.2-.27Z"/>
|
||||||
|
<path class="st0" d="M279.79,140.28c0-.15.1-.25.25-.25h2.58c.15,0,.23.08.25.25.03,2.09,1.71,3.28,4.04,3.28,3.1,0,4.71-1.78,5.63-5.71l.28-1.26c-1.34,1.56-3.12,2.58-5.31,2.58-5.06,0-6.85-4.72-5.7-9.68.99-4.31,3.89-7.89,8.34-7.89,2.88,0,4.54,1.44,5.26,3.54l.65-3.05c.03-.15.13-.22.27-.22h2.58c.17,0,.25.1.22.27l-2.04,8.63-1.61,7.12c-1.21,5.26-4,7.81-8.73,7.81-4.04,0-6.97-2.14-6.97-5.41ZM294.28,130.83c.82-3.6.13-7.12-3.59-7.12-3.23,0-5.08,2.7-5.83,5.93-.87,3.77-.02,7.42,3.54,7.42,3.02,0,5.09-2.78,5.88-6.23Z"/>
|
||||||
|
<path class="st0" d="M307.42,138.82l13.57-22.99c.07-.12.15-.17.28-.17h3.69c.15,0,.23.07.25.23l2.85,22.95c.02.17-.08.27-.23.27h-2.56c-.15,0-.23-.08-.25-.23l-.79-6.85h-9.53l-3.95,6.92c-.07.12-.15.17-.29.17h-2.88c-.18,0-.25-.12-.15-.3ZM323.99,129.52l-1.31-11.61-6.62,11.61h7.92Z"/>
|
||||||
|
<path class="st0" d="M332.8,132.49l.74-3.25,1.61-7.15c.03-.15.13-.22.27-.22h2.63c.17,0,.25.1.2.27l-1.64,6.82-.72,3.3c-.75,3.3.49,4.94,2.78,4.94,2.63,0,4.49-2.43,5.63-5.19l.72-3.08,1.51-6.84c.03-.15.13-.22.27-.22h2.66c.17,0,.25.1.22.27l-1.84,7.57-2.08,9.2c-.02.15-.12.22-.25.22h-2.51c-.15,0-.25-.1-.2-.27l.69-2.76c-1.24,1.86-3.43,3.43-6.01,3.43-3.38,0-5.71-2.48-4.66-7.04Z"/>
|
||||||
|
<path class="st0" d="M353.75,134.4l2.4-10.29h-1.96c-.17,0-.25-.1-.22-.29l.4-1.74c.03-.15.13-.22.27-.22h2.01l.89-4.1c.03-.15.13-.22.27-.22h2.66c.17,0,.25.1.22.27l-.99,4.05h3.97c.17,0,.25.1.22.27l-.42,1.76c-.03.13-.13.22-.27.22h-4.04l-2.35,10.22c-.45,1.98.08,2.78,1.56,2.78.59,0,1.26-.08,1.78-.2.18-.05.28.05.23.24l-.37,1.62c-.03.13-.1.2-.2.23-.75.22-1.71.38-2.58.38-2.35,0-4.37-1.26-3.49-4.99Z"/>
|
||||||
|
<path class="st0" d="M365.46,129.28c1.02-4.34,4.25-7.77,9.1-7.77,5.75,0,8.31,4.74,7.04,10.19-1.02,4.34-4.24,7.77-9.08,7.77-5.76,0-8.33-4.74-7.05-10.19ZM378.51,131.48c.97-4.12-.25-7.86-4.07-7.86-3.17,0-5.13,2.61-5.9,5.88-.97,4.12.25,7.86,4.07,7.86,3.17,0,5.13-2.61,5.9-5.88Z"/>
|
||||||
|
<path class="st0" d="M384.76,138.85l1.83-7.57,2.08-9.2c.03-.15.13-.22.27-.22h2.5c.17,0,.25.1.22.27l-.7,2.76c1.19-1.84,3.22-3.43,5.71-3.43,2.18,0,3.85,1.17,4.31,3.45,1.27-1.84,3.42-3.45,5.93-3.45,3.25,0,5.55,2.45,4.51,7.04l-.75,3.25-1.61,7.15c-.02.15-.12.22-.25.22h-2.63c-.17,0-.25-.1-.22-.27l1.64-6.82.74-3.3c.79-3.47-.49-4.94-2.46-4.94-2.24,0-3.84,2.04-4.98,4.52-.02.25-.05.55-.12.84l-.6,2.6-1.61,7.15c-.03.15-.13.22-.27.22h-2.63c-.15,0-.25-.1-.2-.27l1.64-6.82.74-3.3c.77-3.47-.49-4.94-2.48-4.94-2.41,0-4.09,2.41-5.23,5.19l-.72,3.08-1.51,6.84c-.03.15-.13.22-.27.22h-2.66c-.15,0-.25-.1-.2-.27Z"/>
|
||||||
|
<path class="st0" d="M415.88,129.55c1-4.36,3.89-7.96,8.36-7.96,2.85,0,4.49,1.47,5.21,3.55l.67-3.07c.03-.15.13-.22.27-.22h2.6c.17,0,.25.1.22.27l-1.96,8.23-1.91,8.54c-.03.15-.13.22-.27.22h-2.51c-.15,0-.25-.1-.2-.27l.54-2.13c-1.36,1.59-3.15,2.65-5.34,2.65-4.99,0-6.87-4.66-5.66-9.82ZM428.31,130.98c.85-3.72.13-7.27-3.57-7.27-3.2,0-5.04,2.71-5.81,5.95-.92,4,.03,7.61,3.52,7.61,3,0,5.04-2.78,5.86-6.28Z"/>
|
||||||
|
<path class="st0" d="M437.29,134.4l2.4-10.29h-1.96c-.17,0-.25-.1-.22-.29l.4-1.74c.03-.15.13-.22.27-.22h2.01l.89-4.1c.03-.15.13-.22.27-.22h2.66c.17,0,.25.1.22.27l-.99,4.05h3.97c.17,0,.25.1.22.27l-.42,1.76c-.03.13-.13.22-.27.22h-4.04l-2.35,10.22c-.45,1.98.08,2.78,1.56,2.78.59,0,1.26-.08,1.78-.2.18-.05.28.05.23.24l-.37,1.62c-.03.13-.1.2-.2.23-.75.22-1.71.38-2.58.38-2.35,0-4.37-1.26-3.49-4.99Z"/>
|
||||||
|
<path class="st0" d="M448.39,138.85l2.04-8.65,1.83-8.13c.03-.15.13-.22.27-.22h2.65c.17,0,.25.1.22.27l-1.94,8.06-1.94,8.71c-.02.15-.13.22-.27.22h-2.63c-.17,0-.25-.1-.22-.27ZM452.85,119.55l.65-2.73c.03-.15.13-.22.27-.22h2.61c.17,0,.25.1.22.27l-.64,2.75c-.03.13-.13.22-.27.22h-2.63c-.17,0-.25-.12-.22-.28Z"/>
|
||||||
|
<path class="st0" d="M458.71,129.28c1.02-4.34,4.25-7.77,9.1-7.77,5.75,0,8.31,4.74,7.04,10.19-1.02,4.34-4.24,7.77-9.08,7.77-5.76,0-8.33-4.74-7.05-10.19ZM471.76,131.48c.97-4.12-.25-7.86-4.07-7.86-3.17,0-5.13,2.61-5.9,5.88-.97,4.12.25,7.86,4.07,7.86,3.17,0,5.13-2.61,5.9-5.88Z"/>
|
||||||
|
<path class="st0" d="M478,138.85l1.83-7.57,2.08-9.2c.03-.15.13-.22.27-.22h2.5c.17,0,.25.1.22.27l-.7,2.76c1.24-1.86,3.43-3.43,6.01-3.43,3.38,0,5.7,2.48,4.66,7.04l-.74,3.25-1.61,7.15c-.03.15-.13.22-.27.22h-2.63c-.17,0-.25-.1-.2-.27l1.64-6.82.74-3.3c.74-3.3-.5-4.94-2.8-4.94-2.63,0-4.49,2.43-5.63,5.19l-.72,3.08-1.51,6.84c-.03.15-.13.22-.27.22h-2.66c-.15,0-.25-.1-.2-.27Z"/>
|
||||||
|
<path class="st0" d="M506.33,138.85l2.81-11.76,2.5-11.21c.03-.15.13-.22.27-.22h7.04c5.68,0,8.44,3.43,7.37,8.13-.9,3.89-4.31,6.28-9.6,6.28h-5.23l-1.98,8.83c-.03.15-.13.22-.27.22h-2.7c-.17,0-.25-.1-.22-.27ZM516.95,127.74c3.6,0,5.7-1.62,6.3-4.22.7-3.08-.79-5.51-4.52-5.51h-4.41l-2.33,9.73h4.96Z"/>
|
||||||
|
<path class="st0" d="M527.7,138.85l2.78-11.61,2.53-11.36c.03-.15.13-.22.27-.22h2.56c.17,0,.25.1.22.27l-2.7,11.28-2.61,11.69c-.03.15-.13.22-.27.22h-2.56c-.17,0-.27-.1-.22-.27Z"/>
|
||||||
|
<path class="st0" d="M537.92,129.55c1-4.36,3.89-7.96,8.36-7.96,2.85,0,4.49,1.47,5.21,3.55l.67-3.07c.03-.15.13-.22.27-.22h2.6c.17,0,.25.1.22.27l-1.96,8.23-1.91,8.54c-.03.15-.13.22-.27.22h-2.51c-.15,0-.25-.1-.2-.27l.54-2.13c-1.36,1.59-3.15,2.65-5.34,2.65-4.99,0-6.87-4.66-5.66-9.82ZM550.35,130.98c.85-3.72.13-7.27-3.57-7.27-3.2,0-5.04,2.71-5.81,5.95-.92,4,.03,7.61,3.52,7.61,3,0,5.04-2.78,5.86-6.28Z"/>
|
||||||
|
<path class="st0" d="M559.32,134.4l2.4-10.29h-1.96c-.17,0-.25-.1-.22-.29l.4-1.74c.03-.15.13-.22.27-.22h2.01l.89-4.1c.03-.15.13-.22.27-.22h2.66c.17,0,.25.1.22.27l-.99,4.05h3.97c.17,0,.25.1.22.27l-.42,1.76c-.03.13-.13.22-.27.22h-4.04l-2.35,10.22c-.45,1.98.08,2.78,1.56,2.78.59,0,1.26-.08,1.78-.2.18-.05.28.05.23.24l-.37,1.62c-.03.13-.1.2-.2.23-.75.22-1.71.38-2.58.38-2.35,0-4.37-1.26-3.49-4.99Z"/>
|
||||||
|
<path class="st0" d="M572.12,138.85l1.83-7.52,1.71-7.22h-2.45c-.17,0-.25-.1-.22-.29l.42-1.74c.03-.15.13-.22.27-.22h2.5l.37-1.56c.85-3.77,3.32-5.09,5.71-5.09.8,0,1.64.12,2.23.25.15.05.22.15.18.3l-.4,1.69c-.03.17-.13.22-.3.17-.45-.12-.97-.17-1.57-.17-1.36,0-2.4.85-2.9,3.08l-.32,1.32h3.79c.17,0,.25.1.22.27l-.4,1.76c-.03.13-.13.22-.27.22h-3.85l-1.66,7.22-1.64,7.57c-.03.15-.13.22-.27.22h-2.75c-.17,0-.25-.1-.22-.27Z"/>
|
||||||
|
<path class="st0" d="M584.65,129.28c1.02-4.34,4.25-7.77,9.1-7.77,5.75,0,8.31,4.74,7.04,10.19-1.02,4.34-4.24,7.77-9.08,7.77-5.76,0-8.33-4.74-7.05-10.19ZM597.7,131.48c.97-4.12-.25-7.86-4.07-7.86-3.17,0-5.13,2.61-5.9,5.88-.97,4.12.25,7.86,4.07,7.86,3.17,0,5.13-2.61,5.9-5.88Z"/>
|
||||||
|
<path class="st0" d="M603.95,138.85l2.04-8.54,1.83-8.23c.03-.15.13-.22.27-.22h2.56c.15,0,.25.1.2.27l-.79,3.07c1.74-2.29,4.07-3.5,6.42-3.5.37,0,.72.03,1.02.12.15.03.2.13.17.28l-.44,1.88c-.03.15-.13.2-.29.18-.27-.07-.59-.08-.9-.08-2.76,0-5.55,1.93-6.89,5.38l-2.14,9.45c-.03.15-.13.22-.27.22h-2.58c-.17,0-.27-.1-.22-.27Z"/>
|
||||||
|
<path class="st0" d="M618.42,138.85l1.83-7.57,2.08-9.2c.03-.15.13-.22.27-.22h2.5c.17,0,.25.1.22.27l-.7,2.76c1.19-1.84,3.22-3.43,5.71-3.43,2.18,0,3.85,1.17,4.31,3.45,1.27-1.84,3.42-3.45,5.93-3.45,3.25,0,5.55,2.45,4.51,7.04l-.75,3.25-1.61,7.15c-.02.15-.12.22-.25.22h-2.63c-.17,0-.25-.1-.22-.27l1.64-6.82.74-3.3c.79-3.47-.49-4.94-2.46-4.94-2.25,0-3.84,2.04-4.98,4.52-.02.25-.05.55-.12.84l-.6,2.6-1.61,7.15c-.03.15-.13.22-.27.22h-2.63c-.15,0-.25-.1-.2-.27l1.64-6.82.74-3.3c.77-3.47-.49-4.94-2.48-4.94-2.41,0-4.09,2.41-5.23,5.19l-.72,3.08-1.51,6.84c-.03.15-.13.22-.27.22h-2.66c-.15,0-.25-.1-.2-.27Z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 14 KiB |
@@ -0,0 +1,3 @@
|
|||||||
|
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.0001 7.5C15.2717 7.50006 15.5359 7.58858 15.7527 7.75216C15.9695 7.91575 16.1271 8.14551 16.2017 8.40667L17.5567 13.15C17.8485 14.1715 18.3958 15.1018 19.147 15.853C19.8982 16.6043 20.8285 17.1516 21.8501 17.4433L26.5934 18.7983C26.8544 18.8731 27.084 19.0308 27.2474 19.2476C27.4108 19.4644 27.4992 19.7285 27.4992 20C27.4992 20.2715 27.4108 20.5356 27.2474 20.7524C27.084 20.9692 26.8544 21.1269 26.5934 21.2017L21.8501 22.5567C20.8285 22.8484 19.8982 23.3957 19.147 24.147C18.3958 24.8982 17.8485 25.8285 17.5567 26.85L16.2017 31.5933C16.127 31.8543 15.9693 32.0839 15.7525 32.2473C15.5357 32.4107 15.2716 32.4991 15.0001 32.4991C14.7286 32.4991 14.4645 32.4107 14.2477 32.2473C14.0309 32.0839 13.8732 31.8543 13.7984 31.5933L12.4434 26.85C12.1517 25.8285 11.6043 24.8982 10.8531 24.147C10.1019 23.3957 9.17161 22.8484 8.15008 22.5567L3.40674 21.2017C3.14575 21.1269 2.91619 20.9692 2.75278 20.7524C2.58937 20.5356 2.50098 20.2715 2.50098 20C2.50098 19.7285 2.58937 19.4644 2.75278 19.2476C2.91619 19.0308 3.14575 18.8731 3.40674 18.7983L8.15008 17.4433C9.17161 17.1516 10.1019 16.6043 10.8531 15.853C11.6043 15.1018 12.1517 14.1715 12.4434 13.15L13.7984 8.40667C13.873 8.14551 14.0306 7.91575 14.2475 7.75216C14.4643 7.58858 14.7285 7.50006 15.0001 7.5ZM30.0001 2.5C30.2789 2.49984 30.5498 2.59294 30.7697 2.76448C30.9896 2.93601 31.1457 3.17614 31.2134 3.44667L31.6434 5.17333C32.0367 6.74 33.2601 7.96333 34.8267 8.35667L36.5534 8.78667C36.8245 8.8538 37.0652 9.00976 37.2373 9.22967C37.4094 9.44957 37.5029 9.72077 37.5029 10C37.5029 10.2792 37.4094 10.5504 37.2373 10.7703C37.0652 10.9902 36.8245 11.1462 36.5534 11.2133L34.8267 11.6433C33.2601 12.0367 32.0367 13.26 31.6434 14.8267L31.2134 16.5533C31.1463 16.8244 30.9903 17.0651 30.7704 17.2372C30.5505 17.4093 30.2793 17.5028 30.0001 17.5028C29.7208 17.5028 29.4496 17.4093 29.2297 17.2372C29.0098 17.0651 28.8539 16.8244 28.7867 16.5533L28.3567 14.8267C28.1644 14.0574 27.7667 13.3548 27.2059 12.7941C26.6452 12.2334 25.9427 11.8356 25.1734 11.6433L23.4467 11.2133C23.1757 11.1462 22.9349 10.9902 22.7629 10.7703C22.5908 10.5504 22.4973 10.2792 22.4973 10C22.4973 9.72077 22.5908 9.44957 22.7629 9.22967C22.9349 9.00976 23.1757 8.8538 23.4467 8.78667L25.1734 8.35667C25.9427 8.16435 26.6452 7.76658 27.2059 7.20587C27.7667 6.64517 28.1644 5.94262 28.3567 5.17333L28.7867 3.44667C28.8544 3.17614 29.0106 2.93601 29.2305 2.76448C29.4503 2.59294 29.7212 2.49984 30.0001 2.5ZM27.5001 25C27.7626 24.9999 28.0185 25.0824 28.2315 25.2358C28.4445 25.3893 28.6038 25.6059 28.6867 25.855L29.3434 27.8267C29.5934 28.5717 30.1767 29.1583 30.9234 29.4067L32.8951 30.065C33.1434 30.1484 33.3592 30.3076 33.5121 30.5202C33.665 30.7328 33.7472 30.9881 33.7472 31.25C33.7472 31.5119 33.665 31.7672 33.5121 31.9798C33.3592 32.1924 33.1434 32.3517 32.8951 32.435L30.9234 33.0933C30.1784 33.3433 29.5917 33.9267 29.3434 34.6733L28.6851 36.645C28.6017 36.8933 28.4425 37.1091 28.2299 37.262C28.0172 37.4149 27.762 37.4972 27.5001 37.4972C27.2382 37.4972 26.9829 37.4149 26.7703 37.262C26.5577 37.1091 26.3984 36.8933 26.3151 36.645L25.6567 34.6733C25.534 34.3055 25.3273 33.9712 25.0531 33.697C24.7789 33.4228 24.4446 33.2161 24.0767 33.0933L22.1051 32.435C21.8568 32.3517 21.641 32.1924 21.4881 31.9798C21.3352 31.7672 21.2529 31.5119 21.2529 31.25C21.2529 30.9881 21.3352 30.7328 21.4881 30.5202C21.641 30.3076 21.8568 30.1484 22.1051 30.065L24.0767 29.4067C24.8217 29.1567 25.4084 28.5733 25.6567 27.8267L26.3151 25.855C26.3979 25.6062 26.557 25.3898 26.7696 25.2363C26.9823 25.0829 27.2378 25.0002 27.5001 25Z" fill="#DFC7FD"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 3.6 KiB |
@@ -1,3 +1,21 @@
|
|||||||
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="118" height="118" viewBox="0 0 118 118" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.0001 7.5C15.2717 7.50006 15.5359 7.58858 15.7527 7.75216C15.9695 7.91575 16.1271 8.14551 16.2017 8.40667L17.5567 13.15C17.8485 14.1715 18.3958 15.1018 19.147 15.853C19.8982 16.6043 20.8285 17.1516 21.8501 17.4433L26.5934 18.7983C26.8544 18.8731 27.084 19.0308 27.2474 19.2476C27.4108 19.4644 27.4992 19.7285 27.4992 20C27.4992 20.2715 27.4108 20.5356 27.2474 20.7524C27.084 20.9692 26.8544 21.1269 26.5934 21.2017L21.8501 22.5567C20.8285 22.8484 19.8982 23.3957 19.147 24.147C18.3958 24.8982 17.8485 25.8285 17.5567 26.85L16.2017 31.5933C16.127 31.8543 15.9693 32.0839 15.7525 32.2473C15.5357 32.4107 15.2716 32.4991 15.0001 32.4991C14.7286 32.4991 14.4645 32.4107 14.2477 32.2473C14.0309 32.0839 13.8732 31.8543 13.7984 31.5933L12.4434 26.85C12.1517 25.8285 11.6043 24.8982 10.8531 24.147C10.1019 23.3957 9.17161 22.8484 8.15008 22.5567L3.40674 21.2017C3.14575 21.1269 2.91619 20.9692 2.75278 20.7524C2.58937 20.5356 2.50098 20.2715 2.50098 20C2.50098 19.7285 2.58937 19.4644 2.75278 19.2476C2.91619 19.0308 3.14575 18.8731 3.40674 18.7983L8.15008 17.4433C9.17161 17.1516 10.1019 16.6043 10.8531 15.853C11.6043 15.1018 12.1517 14.1715 12.4434 13.15L13.7984 8.40667C13.873 8.14551 14.0306 7.91575 14.2475 7.75216C14.4643 7.58858 14.7285 7.50006 15.0001 7.5ZM30.0001 2.5C30.2789 2.49984 30.5498 2.59294 30.7697 2.76448C30.9896 2.93601 31.1457 3.17614 31.2134 3.44667L31.6434 5.17333C32.0367 6.74 33.2601 7.96333 34.8267 8.35667L36.5534 8.78667C36.8245 8.8538 37.0652 9.00976 37.2373 9.22967C37.4094 9.44957 37.5029 9.72077 37.5029 10C37.5029 10.2792 37.4094 10.5504 37.2373 10.7703C37.0652 10.9902 36.8245 11.1462 36.5534 11.2133L34.8267 11.6433C33.2601 12.0367 32.0367 13.26 31.6434 14.8267L31.2134 16.5533C31.1463 16.8244 30.9903 17.0651 30.7704 17.2372C30.5505 17.4093 30.2793 17.5028 30.0001 17.5028C29.7208 17.5028 29.4496 17.4093 29.2297 17.2372C29.0098 17.0651 28.8539 16.8244 28.7867 16.5533L28.3567 14.8267C28.1644 14.0574 27.7667 13.3548 27.2059 12.7941C26.6452 12.2334 25.9427 11.8356 25.1734 11.6433L23.4467 11.2133C23.1757 11.1462 22.9349 10.9902 22.7629 10.7703C22.5908 10.5504 22.4973 10.2792 22.4973 10C22.4973 9.72077 22.5908 9.44957 22.7629 9.22967C22.9349 9.00976 23.1757 8.8538 23.4467 8.78667L25.1734 8.35667C25.9427 8.16435 26.6452 7.76658 27.2059 7.20587C27.7667 6.64517 28.1644 5.94262 28.3567 5.17333L28.7867 3.44667C28.8544 3.17614 29.0106 2.93601 29.2305 2.76448C29.4503 2.59294 29.7212 2.49984 30.0001 2.5ZM27.5001 25C27.7626 24.9999 28.0185 25.0824 28.2315 25.2358C28.4445 25.3893 28.6038 25.6059 28.6867 25.855L29.3434 27.8267C29.5934 28.5717 30.1767 29.1583 30.9234 29.4067L32.8951 30.065C33.1434 30.1484 33.3592 30.3076 33.5121 30.5202C33.665 30.7328 33.7472 30.9881 33.7472 31.25C33.7472 31.5119 33.665 31.7672 33.5121 31.9798C33.3592 32.1924 33.1434 32.3517 32.8951 32.435L30.9234 33.0933C30.1784 33.3433 29.5917 33.9267 29.3434 34.6733L28.6851 36.645C28.6017 36.8933 28.4425 37.1091 28.2299 37.262C28.0172 37.4149 27.762 37.4972 27.5001 37.4972C27.2382 37.4972 26.9829 37.4149 26.7703 37.262C26.5577 37.1091 26.3984 36.8933 26.3151 36.645L25.6567 34.6733C25.534 34.3055 25.3273 33.9712 25.0531 33.697C24.7789 33.4228 24.4446 33.2161 24.0767 33.0933L22.1051 32.435C21.8568 32.3517 21.641 32.1924 21.4881 31.9798C21.3352 31.7672 21.2529 31.5119 21.2529 31.25C21.2529 30.9881 21.3352 30.7328 21.4881 30.5202C21.641 30.3076 21.8568 30.1484 22.1051 30.065L24.0767 29.4067C24.8217 29.1567 25.4084 28.5733 25.6567 27.8267L26.3151 25.855C26.3979 25.6062 26.557 25.3898 26.7696 25.2363C26.9823 25.0829 27.2378 25.0002 27.5001 25Z" fill="#DFC7FD"/>
|
<g filter="url(#filter0_d_2381_2707)">
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M48.9982 30C49.5414 30.0001 50.0698 30.1771 50.5034 30.5043C50.9371 30.8315 51.2523 31.291 51.4015 31.8133L54.1115 41.3C54.695 43.3431 55.7897 45.2037 57.2921 46.7061C58.7945 48.2085 60.6551 49.3032 62.6982 49.8867L72.1849 52.5967C72.7068 52.7462 73.166 53.0616 73.4928 53.4952C73.8196 53.9288 73.9964 54.457 73.9964 55C73.9964 55.543 73.8196 56.0712 73.4928 56.5048C73.166 56.9384 72.7068 57.2538 72.1849 57.4033L62.6982 60.1133C60.6551 60.6968 58.7945 61.7915 57.2921 63.2939C55.7897 64.7963 54.695 66.6569 54.1115 68.7L51.4015 78.1867C51.252 78.7086 50.9366 79.1678 50.503 79.4946C50.0694 79.8214 49.5412 79.9982 48.9982 79.9982C48.4552 79.9982 47.927 79.8214 47.4934 79.4946C47.0598 79.1678 46.7444 78.7086 46.5949 78.1867L43.8849 68.7C43.3014 66.6569 42.2067 64.7963 40.7043 63.2939C39.2019 61.7915 37.3413 60.6968 35.2982 60.1133L25.8115 57.4033C25.2895 57.2538 24.8304 56.9384 24.5036 56.5048C24.1768 56.0712 24 55.543 24 55C24 54.457 24.1768 53.9288 24.5036 53.4952C24.8304 53.0616 25.2895 52.7462 25.8115 52.5967L35.2982 49.8867C37.3413 49.3032 39.2019 48.2085 40.7043 46.7061C42.2067 45.2037 43.3014 43.3431 43.8849 41.3L46.5949 31.8133C46.7441 31.291 47.0593 30.8315 47.493 30.5043C47.9266 30.1771 48.455 30.0001 48.9982 30ZM78.9982 20C79.5559 19.9997 80.0977 20.1859 80.5374 20.529C80.9771 20.872 81.2895 21.3523 81.4249 21.8933L82.2849 25.3467C83.0715 28.48 85.5182 30.9267 88.6515 31.7133L92.1049 32.5733C92.6469 32.7076 93.1285 33.0195 93.4726 33.4593C93.8168 33.8991 94.0038 34.4415 94.0038 35C94.0038 35.5585 93.8168 36.1009 93.4726 36.5407C93.1285 36.9805 92.6469 37.2924 92.1049 37.4267L88.6515 38.2867C85.5182 39.0733 83.0715 41.52 82.2849 44.6533L81.4249 48.1067C81.2906 48.6488 80.9787 49.1303 80.5389 49.4744C80.099 49.8186 79.5567 50.0056 78.9982 50.0056C78.4397 50.0056 77.8973 49.8186 77.4575 49.4744C77.0177 49.1303 76.7058 48.6488 76.5715 48.1067L75.7115 44.6533C75.3269 43.1148 74.5314 41.7097 73.4099 40.5882C72.2885 39.4668 70.8834 38.6713 69.3449 38.2867L65.8915 37.4267C65.3494 37.2924 64.8679 36.9805 64.5238 36.5407C64.1796 36.1009 63.9926 35.5585 63.9926 35C63.9926 34.4415 64.1796 33.8991 64.5238 33.4593C64.8679 33.0195 65.3494 32.7076 65.8915 32.5733L69.3449 31.7133C70.8834 31.3287 72.2885 30.5332 73.4099 29.4117C74.5314 28.2903 75.3269 26.8852 75.7115 25.3467L76.5715 21.8933C76.7069 21.3523 77.0192 20.872 77.459 20.529C77.8987 20.1859 78.4405 19.9997 78.9982 20ZM73.9982 65C74.5232 64.9997 75.0351 65.1647 75.4611 65.4716C75.8871 65.7786 76.2056 66.2118 76.3715 66.71L77.6849 70.6533C78.1849 72.1433 79.3515 73.3167 80.8449 73.8133L84.7882 75.13C85.2847 75.2967 85.7164 75.6152 86.0222 76.0404C86.328 76.4656 86.4925 76.9762 86.4925 77.5C86.4925 78.0238 86.328 78.5343 86.0222 78.9596C85.7164 79.3848 85.2847 79.7033 84.7882 79.87L80.8449 81.1867C79.3549 81.6867 78.1815 82.8533 77.6849 84.3467L76.3682 88.29C76.2015 88.7865 75.883 89.2182 75.4578 89.524C75.0325 89.8298 74.522 89.9943 73.9982 89.9943C73.4744 89.9943 72.9638 89.8298 72.5386 89.524C72.1133 89.2182 71.7949 88.7865 71.6282 88.29L70.3115 84.3467C70.066 83.6109 69.6527 82.9424 69.1042 82.394C68.5558 81.8455 67.8873 81.4322 67.1515 81.1867L63.2082 79.87C62.7116 79.7033 62.28 79.3848 61.9742 78.9596C61.6684 78.5343 61.5039 78.0238 61.5039 77.5C61.5039 76.9762 61.6684 76.4656 61.9742 76.0404C62.28 75.6152 62.7116 75.2967 63.2082 75.13L67.1515 73.8133C68.6415 73.3133 69.8149 72.1467 70.3115 70.6533L71.6282 66.71C71.7939 66.2124 72.112 65.7795 72.5373 65.4726C72.9626 65.1657 73.4737 65.0004 73.9982 65Z" fill="url(#paint0_linear_2381_2707)"/>
|
||||||
|
</g>
|
||||||
|
<defs>
|
||||||
|
<filter id="filter0_d_2381_2707" x="0" y="0" width="118.004" height="117.994" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||||
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||||
|
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||||||
|
<feOffset dy="4"/>
|
||||||
|
<feGaussianBlur stdDeviation="12"/>
|
||||||
|
<feComposite in2="hardAlpha" operator="out"/>
|
||||||
|
<feColorMatrix type="matrix" values="0 0 0 0 0.682353 0 0 0 0 0.447059 0 0 0 0 0.976471 0 0 0 0.4 0"/>
|
||||||
|
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_2381_2707"/>
|
||||||
|
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_2381_2707" result="shape"/>
|
||||||
|
</filter>
|
||||||
|
<linearGradient id="paint0_linear_2381_2707" x1="59.0019" y1="89.9943" x2="59.0019" y2="20" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#A65EFF"/>
|
||||||
|
<stop offset="1" stop-color="#EFE3FE"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 4.6 KiB |
@@ -0,0 +1,92 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ko">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>개인정보처리방침 - ADO2</title>
|
||||||
|
<style>
|
||||||
|
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; line-height: 1.8; color: #333; max-width: 800px; margin: 0 auto; padding: 40px 20px; }
|
||||||
|
h1 { font-size: 28px; border-bottom: 2px solid #eee; padding-bottom: 12px; margin-bottom: 30px; }
|
||||||
|
h2 { font-size: 19px; margin-top: 40px; color: #111; }
|
||||||
|
p, li { font-size: 15px; color: #555; margin-bottom: 10px; }
|
||||||
|
ul { padding-left: 20px; }
|
||||||
|
.google-policy { background: #f0f7ff; border-left: 4px solid #4285f4; padding: 16px 20px; margin: 24px 0; border-radius: 4px; }
|
||||||
|
.google-policy p { color: #1a1a2e; margin: 0; }
|
||||||
|
.updated { color: #888; font-size: 14px; margin-bottom: 30px; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>개인정보처리방침 (Privacy Policy)</h1>
|
||||||
|
<p class="updated"><strong>시행일:</strong> 2026년 5월 7일 | <strong>최종 수정일:</strong> 2026년 5월 27일</p>
|
||||||
|
|
||||||
|
<p>㈜에이아이오투오(이하 "회사")는 AI 마케팅 자동화 서비스 ADO2(이하 "서비스")를 제공함에 있어 사용자의 개인정보를 중요시하며, 「개인정보 보호법」 등 관련 법령을 성실히 준수합니다.</p>
|
||||||
|
|
||||||
|
<h2>1. 수집하는 개인정보 항목 및 수집 방법</h2>
|
||||||
|
<p>회사는 서비스 제공을 위해 아래와 같은 개인정보를 수집합니다.</p>
|
||||||
|
<ul>
|
||||||
|
<li><strong>카카오 로그인을 통한 수집:</strong> 이름, 이메일 주소, 프로필 사진 — 서비스 회원 가입 및 로그인에 사용</li>
|
||||||
|
<li><strong>Google 사용자 프로필 :</strong> YouTube 채널 연동 시 연결된 구글 계정의 이름 및 프로필 사진 확인 — 채널 소유자 식별 목적으로만 사용</li>
|
||||||
|
<li><strong>YouTube Data API :</strong> 채널 정보, 동영상 목록, 재생목록 등 YouTube 계정 데이터 (읽기 전용)</li>
|
||||||
|
<li><strong>YouTube Data API :</strong> AI가 생성한 콘텐츠를 YouTube에 업로드하기 위한 동영상 관리 권한</li>
|
||||||
|
<li><strong>YouTube Analytics API :</strong> 채널 및 동영상의 조회수, 시청 시간 등 성과 지표 데이터 (읽기 전용)</li>
|
||||||
|
<li><strong>서비스 이용 과정에서 자동 수집:</strong> 접속 IP, 쿠키, 서비스 이용 기록</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>2. Google 사용자 데이터의 수집 및 이용 목적</h2>
|
||||||
|
<p>회사가 접근하는 Google 사용자 데이터는 아래 목적으로만 사용되며, 명시된 목적 외에는 사용하지 않습니다.</p>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Google 사용자 프로필:</strong> YouTube 채널 연동 과정에서 연결 대상 구글 계정을 식별하는 용도로만 사용하며, 서비스 로그인에는 사용되지 않습니다.</li>
|
||||||
|
<li><strong>YouTube 계정 데이터 (읽기):</strong> 기존 채널 정보·동영상 현황을 분석하여 AI 콘텐츠 전략 수립에 활용합니다.</li>
|
||||||
|
<li><strong>YouTube 동영상 업로드:</strong> AI가 생성한 영상을 사용자의 YouTube 채널에 업로드합니다. 업로드는 반드시 사용자의 명시적 요청에 의해서만 실행됩니다.</li>
|
||||||
|
<li><strong>YouTube 분석 데이터:</strong> 채널 성과 지표를 분석하여 AI 마케팅 전략 수립 및 콘텐츠 최적화에 활용합니다.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="google-policy">
|
||||||
|
<p><strong>[Google API 서비스 사용자 데이터 정책 준수]</strong><br><br>
|
||||||
|
㈜에이아이오투오가 운영하는 ADO2 서비스가 Google API로부터 수신한 정보의 사용 및 타 앱으로의 전송은,
|
||||||
|
<a href="https://developers.google.com/terms/api-services-user-data-policy" target="_blank">Google API 서비스 사용자 데이터 정책</a>의
|
||||||
|
제한적 사용(Limited Use) 요건을 포함한 모든 정책을 엄격히 준수합니다.<br><br>
|
||||||
|
특히, Google API로부터 수신한 데이터는 <strong>AI·ML 모델 학습에 사용되지 않으며</strong>, 사용자가 명시적으로 요청한 서비스 기능 제공 목적 외에는 사용·전송·공유되지 않습니다.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2>3. Google 사용자 데이터의 제3자 공유</h2>
|
||||||
|
<p>회사는 Google API로부터 수신한 사용자 데이터를 아래 경우를 제외하고 어떠한 제3자에게도 판매하거나 공유하지 않습니다.</p>
|
||||||
|
<ul>
|
||||||
|
<li><strong>AI 콘텐츠 생성 처리:</strong> 서비스 제공에 필수적인 AI 생성 기능 수행을 위해 처리 서버로 전달될 수 있으며, 해당 처리는 서비스 제공 목적으로만 사용됩니다.</li>
|
||||||
|
<li><strong>법적 요구:</strong> 관련 법령에 의거한 수사기관 등의 적법한 요청이 있는 경우</li>
|
||||||
|
</ul>
|
||||||
|
<p>Google 사용자 데이터는 광고, 마케팅, 프로파일링 목적으로 사용되지 않습니다.</p>
|
||||||
|
|
||||||
|
<h2>4. Google 사용자 데이터의 저장 및 보안</h2>
|
||||||
|
<ul>
|
||||||
|
<li>Google OAuth 액세스 토큰 및 리프레시 토큰은 암호화된 상태로 보관됩니다.</li>
|
||||||
|
<li>Google API를 통해 읽어온 데이터는 서비스 기능 처리에 필요한 최소한의 시간 동안만 임시 보유하며, 처리 완료 후 삭제됩니다.</li>
|
||||||
|
<li>서버와의 모든 통신은 TLS(HTTPS)를 통해 암호화됩니다.</li>
|
||||||
|
<li>데이터 접근 권한은 서비스 운영에 필요한 최소 인원에게만 부여됩니다.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>5. 개인정보의 보유 및 이용 기간 / 데이터 삭제</h2>
|
||||||
|
<p>원칙적으로 회원 탈퇴 또는 개인정보 수집·이용 목적이 달성된 후에는 해당 정보를 지체 없이 파기합니다. 단, 관련 법령에 따라 보존이 필요한 경우 해당 기간 동안 보관합니다.</p>
|
||||||
|
<ul>
|
||||||
|
<li>전자상거래 관련 기록: 5년 (전자상거래 등에서의 소비자보호에 관한 법률)</li>
|
||||||
|
<li>접속 로그 기록: 3개월 (통신비밀보호법)</li>
|
||||||
|
<li>Google 연동 토큰: 연동 해제 또는 회원 탈퇴 즉시 삭제</li>
|
||||||
|
</ul>
|
||||||
|
<p><strong>데이터 삭제 요청 방법:</strong> 아래 이메일(<a href="mailto:o2oteam@o2o.kr">o2oteam@o2o.kr</a>)로 요청하시면 <strong>영업일 기준 7일 이내</strong>에 처리 결과를 안내해 드립니다. Google 계정 연동 해제는 서비스 내 계정 설정에서 직접 처리하실 수 있으며, 해제 즉시 관련 토큰이 삭제됩니다.</p>
|
||||||
|
|
||||||
|
<h2>6. 정보주체의 권리 및 행사 방법</h2>
|
||||||
|
<p>사용자는 언제든지 자신의 개인정보에 대한 열람, 수정, 삭제, 처리 정지를 요청할 수 있습니다. 서비스 내 계정 설정에서 직접 처리하거나 아래 문의처로 연락해 주시기 바랍니다.</p>
|
||||||
|
<p>또한, <a href="https://myaccount.google.com/permissions" target="_blank">Google 계정 권한 관리 페이지</a>에서 ADO2 앱의 Google 데이터 접근 권한을 언제든지 직접 취소하실 수 있습니다.</p>
|
||||||
|
|
||||||
|
<h2>7. 개인정보 보호책임자 및 문의처</h2>
|
||||||
|
<p>개인정보 보호와 관련된 불만 처리 및 피해 구제에 관한 사항은 아래로 문의해 주시기 바랍니다.</p>
|
||||||
|
<ul>
|
||||||
|
<li><strong>회사명:</strong> ㈜에이아이오투오</li>
|
||||||
|
<li><strong>서비스명:</strong> ADO2</li>
|
||||||
|
<li><strong>이메일:</strong> <a href="mailto:o2oteam@o2o.kr">o2oteam@o2o.kr</a></li>
|
||||||
|
<li><strong>웹사이트:</strong> https://demo.castad.net</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p style="margin-top:40px; font-size:14px; color:#999;">본 방침은 2026년 5월 7일부터 시행됩니다. 최종 수정일: 2026년 5월 27일</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ko">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>서비스 약관 - ADO2</title>
|
||||||
|
<style>
|
||||||
|
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; line-height: 1.8; color: #333; max-width: 800px; margin: 0 auto; padding: 40px 20px; }
|
||||||
|
h1 { font-size: 28px; border-bottom: 2px solid #eee; padding-bottom: 12px; margin-bottom: 30px; }
|
||||||
|
h2 { font-size: 19px; margin-top: 40px; color: #111; }
|
||||||
|
p, li { font-size: 15px; color: #555; margin-bottom: 10px; }
|
||||||
|
ul { padding-left: 20px; }
|
||||||
|
.updated { color: #888; font-size: 14px; margin-bottom: 30px; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>서비스 이용약관 (Terms of Service)</h1>
|
||||||
|
<p class="updated"><strong>시행일:</strong> 2026년 5월 7일 | <strong>최종 수정일:</strong> 2026년 5월 21일</p>
|
||||||
|
|
||||||
|
<h2>제 1 조 (목적)</h2>
|
||||||
|
<p>본 약관은 ㈜에이아이오투오(이하 "회사")가 제공하는 AI 마케팅 자동화 서비스 ADO2(이하 "서비스")의 이용과 관련하여, 회사와 이용자(이하 "회원") 간의 권리, 의무 및 책임사항을 규정함을 목적으로 합니다.</p>
|
||||||
|
|
||||||
|
<h2>제 2 조 (용어의 정의)</h2>
|
||||||
|
<ul>
|
||||||
|
<li>"서비스"라 함은 회사가 제공하는 ADO2 AI 마케팅 자동화 플랫폼 및 관련 제반 기능을 의미합니다.</li>
|
||||||
|
<li>"회원"이라 함은 본 약관에 동의하고 회사와 이용계약을 체결하여 서비스를 이용하는 자를 말합니다.</li>
|
||||||
|
<li>"콘텐츠"라 함은 서비스 내에서 AI가 생성하거나 회원이 등록하는 텍스트, 이미지, 음악, 영상 등 일체의 자료를 말합니다.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>제 3 조 (약관의 효력 및 변경)</h2>
|
||||||
|
<p>회사는 본 약관의 내용을 서비스 화면에 게시하며, 관련 법령을 위배하지 않는 범위에서 약관을 개정할 수 있습니다. 약관이 변경되는 경우 시행일 7일 전부터 공지합니다.</p>
|
||||||
|
|
||||||
|
<h2>제 4 조 (서비스의 제공 및 변경)</h2>
|
||||||
|
<p>회사는 AI 기반 마케팅 콘텐츠(가사, 이미지, 영상 등) 자동 생성, Google·YouTube 등 외부 플랫폼 연동, SNS 자동 배포 등의 서비스를 제공합니다. 운영상·기술상의 필요에 따라 서비스의 전부 또는 일부를 변경할 수 있습니다.</p>
|
||||||
|
|
||||||
|
<h2>제 5 조 (회원의 의무)</h2>
|
||||||
|
<ul>
|
||||||
|
<li>타인의 Google 계정 등 외부 서비스 계정을 무단으로 도용하여 서비스를 이용해서는 안 됩니다.</li>
|
||||||
|
<li>스팸 발송, API 한도 고의 초과, 허위 정보 등록 등 비정상적인 방법으로 서비스를 이용해서는 안 됩니다.</li>
|
||||||
|
<li>회사 또는 제3자의 지식재산권을 침해해서는 안 됩니다.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>제 6 조 (외부 API 연동 및 데이터 활용)</h2>
|
||||||
|
<p>서비스는 Google, YouTube, Naver 등의 제3자 API를 활용하여 마케팅 자동화 기능을 제공합니다. 특히 YouTube 서비스 연동을 위해 YouTube Data API 및 YouTube Analytics API를 사용하며, 이를 통해 수집·처리되는 데이터는 <a href="/privacy.html">개인정보처리방침</a>에 따라 관리됩니다. 회원은 각 외부 서비스의 이용약관 및 정책을 준수할 의무가 있으며, 외부 API 제공사의 정책 변경으로 인한 서비스 제한에 대해 회사는 면책됩니다.</p>
|
||||||
|
<p>YouTube API 서비스 이용과 관련하여 <a href="https://www.youtube.com/t/terms" target="_blank">YouTube 이용약관</a> 및 <a href="https://policies.google.com/privacy" target="_blank">Google 개인정보처리방침</a>이 함께 적용됩니다.</p>
|
||||||
|
|
||||||
|
<h2>제 7 조 (AI 생성 콘텐츠의 권리)</h2>
|
||||||
|
<p>서비스 내에서 AI가 생성한 콘텐츠에 대한 권리 관계는 관련 법령 및 회사의 별도 정책에 따릅니다. 회원이 직접 입력한 정보(매장 URL, 상호명 등)를 기반으로 생성된 콘텐츠에 대한 책임은 회원에게 있습니다.</p>
|
||||||
|
|
||||||
|
<h2>제 8 조 (책임 제한)</h2>
|
||||||
|
<p>회사는 천재지변, 외부 플랫폼(Google, YouTube, Naver 등)의 장애, 통신 장애 등 불가항력으로 서비스를 제공할 수 없는 경우 책임이 면제됩니다.</p>
|
||||||
|
|
||||||
|
<h2>제 9 조 (준거법 및 재판관할)</h2>
|
||||||
|
<p>본 약관과 관련된 분쟁은 대한민국 법을 준거법으로 하며, 소송은 회사의 소재지를 관할하는 법원에 제소합니다.</p>
|
||||||
|
|
||||||
|
<h2>문의처</h2>
|
||||||
|
<ul>
|
||||||
|
<li><strong>회사명:</strong> ㈜에이아이오투오</li>
|
||||||
|
<li><strong>서비스명:</strong> ADO2</li>
|
||||||
|
<li><strong>이메일:</strong> o2oteam@o2o.kr</li>
|
||||||
|
<li><strong>웹사이트:</strong> https://demo.castad.net</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p style="margin-top:40px; font-size:14px; color:#999;">본 약관은 2026년 5월 7일부터 시행됩니다.</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
+78
-8
@@ -12,7 +12,10 @@ import GenerationFlow from './pages/Dashboard/GenerationFlow';
|
|||||||
import SocialConnectSuccess from './pages/Social/SocialConnectSuccess';
|
import SocialConnectSuccess from './pages/Social/SocialConnectSuccess';
|
||||||
import SocialConnectError from './pages/Social/SocialConnectError';
|
import SocialConnectError from './pages/Social/SocialConnectError';
|
||||||
import YouTubeOAuthCallback from './pages/Social/YouTubeOAuthCallback';
|
import YouTubeOAuthCallback from './pages/Social/YouTubeOAuthCallback';
|
||||||
import { crawlUrl, autocomplete, kakaoCallback, isLoggedIn, saveTokens, AutocompleteRequest } from './utils/api';
|
import ADO2ContentsPage from './pages/Dashboard/ADO2ContentsPage';
|
||||||
|
import VideoDetailPage from './components/VideoDetailPage';
|
||||||
|
import { crawlUrl, autocomplete, marketingAnalysis, kakaoCallback, isLoggedIn, saveTokens, getVideosList, AutocompleteRequest } from './utils/api';
|
||||||
|
import { saveSearchHistory } from './components/SearchHistory/useSearchHistory';
|
||||||
import { CrawlingResponse } from './types/api';
|
import { CrawlingResponse } from './types/api';
|
||||||
|
|
||||||
type ViewMode = 'landing' | 'loading' | 'analysis' | 'login' | 'generation_flow';
|
type ViewMode = 'landing' | 'loading' | 'analysis' | 'login' | 'generation_flow';
|
||||||
@@ -96,8 +99,27 @@ const App: React.FC = () => {
|
|||||||
parseSavedAnalysisData()
|
parseSavedAnalysisData()
|
||||||
);
|
);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
const [isAnalysisComplete, setIsAnalysisComplete] = useState(false);
|
||||||
|
const [afterLoadTarget, setAfterLoadTarget] = useState<ViewMode>('analysis');
|
||||||
const [scrollProgress, setScrollProgress] = useState(0);
|
const [scrollProgress, setScrollProgress] = useState(0);
|
||||||
const [isProcessingCallback, setIsProcessingCallback] = useState(false);
|
const [isProcessingCallback, setIsProcessingCallback] = useState(false);
|
||||||
|
const tutorialVideoCheckedRef = useRef(false);
|
||||||
|
|
||||||
|
// generation_flow 진입 시 영상 보유 여부 확인 → 있으면 튜토리얼 자동 off
|
||||||
|
useEffect(() => {
|
||||||
|
if (viewMode !== 'generation_flow') return;
|
||||||
|
if (tutorialVideoCheckedRef.current) return;
|
||||||
|
tutorialVideoCheckedRef.current = true;
|
||||||
|
const ENABLED_KEY = 'ado2_tutorial_enabled';
|
||||||
|
if (localStorage.getItem(ENABLED_KEY) !== null) return;
|
||||||
|
getVideosList(1, 1).then(response => {
|
||||||
|
const hasVideos = response.items.some(v => v.result_movie_url?.trim());
|
||||||
|
if (hasVideos) {
|
||||||
|
localStorage.setItem(ENABLED_KEY, 'false');
|
||||||
|
window.dispatchEvent(new Event('ado2-tutorial-auto-disable'));
|
||||||
|
}
|
||||||
|
}).catch(() => {});
|
||||||
|
}, [viewMode]);
|
||||||
|
|
||||||
// 카카오 로그인 콜백 처리 (URL에서 토큰 또는 code 파라미터 확인)
|
// 카카오 로그인 콜백 처리 (URL에서 토큰 또는 code 파라미터 확인)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -142,6 +164,12 @@ const App: React.FC = () => {
|
|||||||
localStorage.removeItem('castad_wizard_step');
|
localStorage.removeItem('castad_wizard_step');
|
||||||
localStorage.removeItem('castad_active_item');
|
localStorage.removeItem('castad_active_item');
|
||||||
}
|
}
|
||||||
|
const redirectPath = sessionStorage.getItem('castad_login_redirect');
|
||||||
|
sessionStorage.removeItem('castad_login_redirect');
|
||||||
|
if (redirectPath && redirectPath !== '/') {
|
||||||
|
window.location.href = redirectPath;
|
||||||
|
return;
|
||||||
|
}
|
||||||
setInitialTab('새 프로젝트 만들기');
|
setInitialTab('새 프로젝트 만들기');
|
||||||
setViewMode('generation_flow');
|
setViewMode('generation_flow');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -255,7 +283,9 @@ const App: React.FC = () => {
|
|||||||
const handleStartAnalysis = async (url: string) => {
|
const handleStartAnalysis = async (url: string) => {
|
||||||
if (!url.trim()) return;
|
if (!url.trim()) return;
|
||||||
|
|
||||||
|
setAfterLoadTarget('analysis');
|
||||||
setViewMode('loading');
|
setViewMode('loading');
|
||||||
|
setIsAnalysisComplete(false);
|
||||||
setError(null);
|
setError(null);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -268,18 +298,20 @@ const App: React.FC = () => {
|
|||||||
|
|
||||||
setAnalysisData(data);
|
setAnalysisData(data);
|
||||||
localStorage.setItem(ANALYSIS_DATA_KEY, JSON.stringify(data));
|
localStorage.setItem(ANALYSIS_DATA_KEY, JSON.stringify(data));
|
||||||
setViewMode('analysis');
|
saveSearchHistory({ type: 'url', value: url });
|
||||||
|
setIsAnalysisComplete(true);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Crawling failed:', err);
|
console.error('Crawling failed:', err);
|
||||||
const errorMessage = err instanceof Error ? err.message : t('app.analysisError');
|
setError(t('app.analysisError'));
|
||||||
setError(errorMessage);
|
|
||||||
setViewMode('landing');
|
setViewMode('landing');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 업체명 자동완성으로 분석 시작
|
// 업체명 자동완성으로 분석 시작
|
||||||
const handleAutocomplete = async (request: AutocompleteRequest) => {
|
const handleAutocomplete = async (request: AutocompleteRequest) => {
|
||||||
|
setAfterLoadTarget('analysis');
|
||||||
setViewMode('loading');
|
setViewMode('loading');
|
||||||
|
setIsAnalysisComplete(false);
|
||||||
setError(null);
|
setError(null);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -292,11 +324,36 @@ const App: React.FC = () => {
|
|||||||
|
|
||||||
setAnalysisData(data);
|
setAnalysisData(data);
|
||||||
localStorage.setItem(ANALYSIS_DATA_KEY, JSON.stringify(data));
|
localStorage.setItem(ANALYSIS_DATA_KEY, JSON.stringify(data));
|
||||||
setViewMode('analysis');
|
saveSearchHistory({ type: 'name', value: request.title.replace(/<[^>]*>/g, ''), address: request.address, roadAddress: request.roadAddress });
|
||||||
|
setIsAnalysisComplete(true);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Autocomplete failed:', err);
|
console.error('Autocomplete failed:', err);
|
||||||
const errorMessage = err instanceof Error ? err.message : t('app.autocompleteGeneralError');
|
setError(t('app.autocompleteError'));
|
||||||
setError(errorMessage);
|
setViewMode('landing');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 업체명·주소 수동 입력으로 마케팅 분석 API 호출
|
||||||
|
const handleManualInput = async (businessName: string, address: string) => {
|
||||||
|
setAfterLoadTarget('generation_flow');
|
||||||
|
setViewMode('loading');
|
||||||
|
setIsAnalysisComplete(false);
|
||||||
|
setError(null);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const data = await marketingAnalysis(businessName, address);
|
||||||
|
|
||||||
|
if (!validateCrawlingResponse(data)) {
|
||||||
|
throw new Error(t('app.autocompleteError'));
|
||||||
|
}
|
||||||
|
|
||||||
|
setAnalysisData(data);
|
||||||
|
localStorage.setItem(ANALYSIS_DATA_KEY, JSON.stringify(data));
|
||||||
|
saveSearchHistory({ type: 'name', value: businessName, address, roadAddress: address });
|
||||||
|
setIsAnalysisComplete(true);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Marketing analysis failed:', err);
|
||||||
|
setError(t('app.autocompleteError'));
|
||||||
setViewMode('landing');
|
setViewMode('landing');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -383,6 +440,13 @@ const App: React.FC = () => {
|
|||||||
return <SocialConnectError />;
|
return <SocialConnectError />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 영상 상세 페이지 (/video/{id}) — 인증 게이트는 VideoDetailPage 내부에서 처리
|
||||||
|
const videoDetailMatch = pathname.match(/^\/video\/([^/]+)$/);
|
||||||
|
if (videoDetailMatch) {
|
||||||
|
return <VideoDetailPage videoId={videoDetailMatch[1]} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 카카오 콜백 처리 중 로딩 화면 표시
|
// 카카오 콜백 처리 중 로딩 화면 표시
|
||||||
if (isProcessingCallback) {
|
if (isProcessingCallback) {
|
||||||
return (
|
return (
|
||||||
@@ -395,7 +459,12 @@ const App: React.FC = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (viewMode === 'loading') {
|
if (viewMode === 'loading') {
|
||||||
return <LoadingSection />;
|
return (
|
||||||
|
<LoadingSection
|
||||||
|
isComplete={isAnalysisComplete}
|
||||||
|
onComplete={() => setViewMode(afterLoadTarget)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (viewMode === 'analysis' && analysisData) {
|
if (viewMode === 'analysis' && analysisData) {
|
||||||
@@ -437,6 +506,7 @@ const App: React.FC = () => {
|
|||||||
<HeroSection
|
<HeroSection
|
||||||
onAnalyze={handleStartAnalysis}
|
onAnalyze={handleStartAnalysis}
|
||||||
onAutocomplete={handleAutocomplete}
|
onAutocomplete={handleAutocomplete}
|
||||||
|
onManualInput={handleManualInput}
|
||||||
onTestData={handleTestData}
|
onTestData={handleTestData}
|
||||||
onNext={() => scrollToSection(1)}
|
onNext={() => scrollToSection(1)}
|
||||||
error={error}
|
error={error}
|
||||||
|
|||||||
@@ -0,0 +1,135 @@
|
|||||||
|
import React, { useState, useEffect } from 'react';
|
||||||
|
import { createPortal } from 'react-dom';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import CitySelectModal, { REGIONS } from './CitySelectModal';
|
||||||
|
|
||||||
|
interface BusinessNameInputModalProps {
|
||||||
|
onClose: () => void;
|
||||||
|
onSubmit: (businessName: string, address: string) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const BusinessNameInputModal: React.FC<BusinessNameInputModalProps> = ({ onClose, onSubmit }) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [businessName, setBusinessName] = useState('');
|
||||||
|
const [selectedCity, setSelectedCity] = useState('');
|
||||||
|
const [detailAddress, setDetailAddress] = useState('');
|
||||||
|
const [isCityModalOpen, setIsCityModalOpen] = useState(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
document.body.style.overflow = 'hidden';
|
||||||
|
|
||||||
|
const handleKeyDown = (e: KeyboardEvent) => {
|
||||||
|
if (e.key === 'Escape') onClose();
|
||||||
|
};
|
||||||
|
document.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
document.body.style.overflow = '';
|
||||||
|
document.removeEventListener('keydown', handleKeyDown);
|
||||||
|
};
|
||||||
|
}, [onClose]);
|
||||||
|
|
||||||
|
const handleCitySelect = (city: string) => {
|
||||||
|
const region = REGIONS.find(r => r.cities.includes(city));
|
||||||
|
// 특별시/광역시는 도 이름 없이 도시명만 사용
|
||||||
|
const prefix = region && region.label !== '특별시 / 광역시' ? `${region.label} ` : '';
|
||||||
|
setSelectedCity(`${prefix}${city}`);
|
||||||
|
};
|
||||||
|
|
||||||
|
const isValid = businessName.trim().length > 0 && selectedCity.length > 0 && detailAddress.trim().length > 0;
|
||||||
|
|
||||||
|
const handleSubmit = () => {
|
||||||
|
if (!isValid) return;
|
||||||
|
const fullAddress = `${selectedCity} ${detailAddress.trim()}`;
|
||||||
|
onSubmit(businessName.trim(), fullAddress);
|
||||||
|
onClose();
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleKeyDown = (e: React.KeyboardEvent) => {
|
||||||
|
if (e.key === 'Enter' && isValid) handleSubmit();
|
||||||
|
};
|
||||||
|
|
||||||
|
// CitySelectModal의 selected prop용 — 도시명만 추출
|
||||||
|
const cityOnly = selectedCity.split(' ').pop() ?? '';
|
||||||
|
|
||||||
|
return createPortal(
|
||||||
|
<>
|
||||||
|
<div className="manual-modal-backdrop" onClick={onClose}>
|
||||||
|
<div className="manual-modal" onClick={e => e.stopPropagation()}>
|
||||||
|
<div className="manual-modal-header">
|
||||||
|
<span className="manual-modal-title">{t('landing.hero.manualModalTitle')}</span>
|
||||||
|
<button className="manual-modal-close" onClick={onClose}>✕</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="manual-modal-body">
|
||||||
|
<div className="manual-modal-field">
|
||||||
|
<label className="manual-modal-label">{t('landing.hero.manualLabelName')}</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
className="manual-modal-input"
|
||||||
|
placeholder={t('landing.hero.manualPlaceholderName')}
|
||||||
|
value={businessName}
|
||||||
|
onChange={e => setBusinessName(e.target.value)}
|
||||||
|
onKeyDown={handleKeyDown}
|
||||||
|
maxLength={50}
|
||||||
|
autoFocus
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="manual-modal-field">
|
||||||
|
<label className="manual-modal-label">{t('landing.hero.manualLabelRegion')}</label>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className={`manual-modal-city-btn ${selectedCity ? 'selected' : ''}`}
|
||||||
|
onClick={() => setIsCityModalOpen(true)}
|
||||||
|
>
|
||||||
|
<span>{selectedCity || t('landing.hero.manualPlaceholderRegion')}</span>
|
||||||
|
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||||
|
<path d="M6 9l6 6 6-6" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="manual-modal-field">
|
||||||
|
<label className="manual-modal-label">{t('landing.hero.manualLabelDetail')}</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
className="manual-modal-input"
|
||||||
|
placeholder={t('landing.hero.manualPlaceholderDetail')}
|
||||||
|
value={detailAddress}
|
||||||
|
onChange={e => setDetailAddress(e.target.value)}
|
||||||
|
onKeyDown={handleKeyDown}
|
||||||
|
maxLength={100}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="manual-modal-actions">
|
||||||
|
<button type="button" className="manual-modal-cancel" onClick={onClose}>
|
||||||
|
{t('common.cancel')}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="manual-modal-submit"
|
||||||
|
onClick={handleSubmit}
|
||||||
|
disabled={!isValid}
|
||||||
|
>
|
||||||
|
{t('landing.hero.analyzeButton')}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{isCityModalOpen && (
|
||||||
|
<CitySelectModal
|
||||||
|
selected={cityOnly}
|
||||||
|
onSelect={(city) => { handleCitySelect(city); setIsCityModalOpen(false); }}
|
||||||
|
onClose={() => setIsCityModalOpen(false)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</>,
|
||||||
|
document.body
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default BusinessNameInputModal;
|
||||||
@@ -0,0 +1,159 @@
|
|||||||
|
import React, { useState, useEffect } from 'react';
|
||||||
|
|
||||||
|
export const REGIONS: { label: string; cities: string[] }[] = [
|
||||||
|
{
|
||||||
|
label: '특별시 / 광역시',
|
||||||
|
cities: ['서울시', '부산시', '대구시', '인천시', '광주시', '대전시', '울산시', '세종시'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '경기도',
|
||||||
|
cities: [
|
||||||
|
'수원시', '성남시', '고양시', '용인시', '부천시', '안산시', '안양시', '남양주시',
|
||||||
|
'화성시', '평택시', '의정부시', '시흥시', '파주시', '김포시', '광주시', '광명시',
|
||||||
|
'군포시', '하남시', '오산시', '이천시', '안성시', '구리시', '양주시', '포천시',
|
||||||
|
'여주시', '동두천시', '과천시', '가평군', '양평군', '연천군',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '강원도',
|
||||||
|
cities: [
|
||||||
|
'춘천시', '원주시', '강릉시', '동해시', '태백시', '속초시', '삼척시',
|
||||||
|
'홍천군', '횡성군', '영월군', '평창군', '정선군', '철원군', '화천군',
|
||||||
|
'양구군', '인제군', '고성군', '양양군',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '충청북도',
|
||||||
|
cities: [
|
||||||
|
'청주시', '충주시', '제천시',
|
||||||
|
'보은군', '옥천군', '영동군', '증평군', '진천군', '괴산군', '음성군', '단양군',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '충청남도',
|
||||||
|
cities: [
|
||||||
|
'천안시', '공주시', '보령시', '아산시', '서산시', '논산시', '계룡시', '당진시',
|
||||||
|
'금산군', '부여군', '서천군', '청양군', '홍성군', '예산군', '태안군',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '전라북도',
|
||||||
|
cities: [
|
||||||
|
'전주시', '군산시', '익산시', '정읍시', '남원시', '김제시',
|
||||||
|
'완주군', '진안군', '무주군', '장수군', '임실군', '순창군', '고창군', '부안군',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '전라남도',
|
||||||
|
cities: [
|
||||||
|
'목포시', '여수시', '순천시', '나주시', '광양시',
|
||||||
|
'담양군', '곡성군', '구례군', '고흥군', '보성군', '화순군', '장흥군', '강진군',
|
||||||
|
'해남군', '영암군', '무안군', '함평군', '영광군', '장성군', '완도군', '진도군', '신안군',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '경상북도',
|
||||||
|
cities: [
|
||||||
|
'포항시', '경주시', '김천시', '안동시', '구미시', '영주시', '영천시', '상주시', '문경시', '경산시',
|
||||||
|
'의성군', '청송군', '영양군', '영덕군', '청도군', '고령군', '성주군', '칠곡군',
|
||||||
|
'예천군', '봉화군', '울진군', '울릉군',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '경상남도',
|
||||||
|
cities: [
|
||||||
|
'창원시', '진주시', '통영시', '사천시', '김해시', '밀양시', '거제시', '양산시',
|
||||||
|
'의령군', '함안군', '창녕군', '고성군', '남해군', '하동군', '산청군', '함양군', '거창군', '합천군',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '제주도',
|
||||||
|
cities: ['제주시', '서귀포시'],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
interface CitySelectModalProps {
|
||||||
|
selected: string;
|
||||||
|
onSelect: (city: string) => void;
|
||||||
|
onClose: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const CitySelectModal: React.FC<CitySelectModalProps> = ({ selected, onSelect, onClose }) => {
|
||||||
|
const [activeRegion, setActiveRegion] = useState<string | null>(
|
||||||
|
() => REGIONS.find(r => r.cities.includes(selected))?.label ?? null
|
||||||
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
document.body.style.overflow = 'hidden';
|
||||||
|
return () => { document.body.style.overflow = ''; };
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const activeEntry = REGIONS.find(r => r.label === activeRegion);
|
||||||
|
const cities = activeEntry?.cities ?? [];
|
||||||
|
|
||||||
|
const handleSelect = (value: string) => {
|
||||||
|
onSelect(value === selected ? '' : value);
|
||||||
|
onClose();
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="city-modal-backdrop" onClick={onClose}>
|
||||||
|
<div className="city-modal" onClick={e => e.stopPropagation()}>
|
||||||
|
<div className="city-modal-header">
|
||||||
|
<span className="city-modal-title">
|
||||||
|
{activeRegion ? (
|
||||||
|
<>
|
||||||
|
<button className="city-modal-back" onClick={() => setActiveRegion(null)}>←</button>
|
||||||
|
{activeRegion}
|
||||||
|
</>
|
||||||
|
) : '지역 선택'}
|
||||||
|
</span>
|
||||||
|
<button className="city-modal-close" onClick={onClose}>✕</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{activeRegion === null ? (
|
||||||
|
<div className="city-modal-grid">
|
||||||
|
{REGIONS.map(r => {
|
||||||
|
const isRegionSelected = selected === r.label;
|
||||||
|
const hasCitySelected = r.cities.includes(selected);
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
key={r.label}
|
||||||
|
className={`city-modal-region-item ${isRegionSelected || hasCitySelected ? 'has-selected' : ''}`}
|
||||||
|
onClick={() => setActiveRegion(r.label)}
|
||||||
|
>
|
||||||
|
<span>{r.label}</span>
|
||||||
|
{isRegionSelected && <span className="city-modal-region-badge">전체</span>}
|
||||||
|
{hasCitySelected && <span className="city-modal-region-badge">{selected}</span>}
|
||||||
|
<span className="city-modal-arrow">›</span>
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="city-modal-item-wrap">
|
||||||
|
{activeRegion !== '특별시 / 광역시' && (
|
||||||
|
<button
|
||||||
|
className={`city-modal-item city-modal-item-all ${selected === activeRegion ? 'active' : ''}`}
|
||||||
|
onClick={() => handleSelect(activeRegion!)}
|
||||||
|
>
|
||||||
|
전체
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
{cities.map(city => (
|
||||||
|
<button
|
||||||
|
key={city}
|
||||||
|
className={`city-modal-item ${selected === city ? 'active' : ''}`}
|
||||||
|
onClick={() => handleSelect(city)}
|
||||||
|
>
|
||||||
|
{city}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default CitySelectModal;
|
||||||
@@ -8,10 +8,16 @@ const Footer: React.FC = () => {
|
|||||||
<footer className="landing-footer">
|
<footer className="landing-footer">
|
||||||
<div className="footer-content">
|
<div className="footer-content">
|
||||||
<div className="footer-left">
|
<div className="footer-left">
|
||||||
<img src="/assets/images/logo.svg" alt="CASTAD" className="footer-logo" />
|
<img src="/assets/images/ado2-sidebar-logo.svg" alt="ADO2" className="footer-logo" />
|
||||||
<p className="footer-copyright">Copyright ⓒ O2O Inc. All rights reserved</p>
|
<p className="footer-copyright">Copyright ⓒ O2O Inc. All rights reserved</p>
|
||||||
|
<div className="footer-links">
|
||||||
|
<a href="https://demo.castad.net/privacy.html" rel="noopener noreferrer" className="footer-link">{t('footer.privacyPolicy')}</a>
|
||||||
|
<span className="footer-link-divider">|</span>
|
||||||
|
<a href="https://demo.castad.net/terms.html" rel="noopener noreferrer" className="footer-link">{t('footer.termsOfService')}</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="footer-right">
|
<div className="footer-right">
|
||||||
|
<p className="footer-info">{t('footer.company')}</p>
|
||||||
<p className="footer-info">{t('footer.businessNumber')}</p>
|
<p className="footer-info">{t('footer.businessNumber')}</p>
|
||||||
<p className="footer-info">{t('footer.headquarters')}</p>
|
<p className="footer-info">{t('footer.headquarters')}</p>
|
||||||
<p className="footer-info">{t('footer.researchCenter')}</p>
|
<p className="footer-info">{t('footer.researchCenter')}</p>
|
||||||
|
|||||||
@@ -0,0 +1,100 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { getKakaoLoginUrl } from '../utils/api';
|
||||||
|
|
||||||
|
interface LoginPromptModalProps {
|
||||||
|
onClose: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const LoginPromptModal: React.FC<LoginPromptModalProps> = ({ onClose }) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const handleLogin = async () => {
|
||||||
|
try {
|
||||||
|
sessionStorage.setItem('castad_login_redirect', window.location.pathname);
|
||||||
|
const response = await getKakaoLoginUrl();
|
||||||
|
window.location.href = response.auth_url;
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to get Kakao login URL:', err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
position: 'fixed',
|
||||||
|
inset: 0,
|
||||||
|
background: 'rgba(255, 255, 255, 0.25)',
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
zIndex: 9999,
|
||||||
|
}}
|
||||||
|
onClick={onClose}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
background: '#01282A',
|
||||||
|
border: '1px solid rgba(155, 202, 204, 0.2)',
|
||||||
|
borderRadius: '16px',
|
||||||
|
padding: '40px 32px',
|
||||||
|
width: '360px',
|
||||||
|
maxWidth: '90vw',
|
||||||
|
textAlign: 'center',
|
||||||
|
position: 'relative',
|
||||||
|
}}
|
||||||
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
onClick={onClose}
|
||||||
|
aria-label="닫기"
|
||||||
|
style={{
|
||||||
|
position: 'absolute',
|
||||||
|
top: '16px',
|
||||||
|
right: '16px',
|
||||||
|
background: 'none',
|
||||||
|
border: 'none',
|
||||||
|
cursor: 'pointer',
|
||||||
|
color: '#9BCACC',
|
||||||
|
padding: '4px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.5">
|
||||||
|
<line x1="4" y1="4" x2="16" y2="16"/>
|
||||||
|
<line x1="16" y1="4" x2="4" y2="16"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
<h2 style={{ color: '#FFFFFF', fontSize: '20px', fontWeight: 600, marginBottom: '12px' }}>
|
||||||
|
{t('loginPrompt.title')}
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<button
|
||||||
|
onClick={handleLogin}
|
||||||
|
style={{
|
||||||
|
width: '50%',
|
||||||
|
margin: '0 auto',
|
||||||
|
padding: '14px',
|
||||||
|
background: '#FEE500',
|
||||||
|
color: '#3C1E1E',
|
||||||
|
border: 'none',
|
||||||
|
borderRadius: '8px',
|
||||||
|
fontSize: '15px',
|
||||||
|
fontWeight: 600,
|
||||||
|
cursor: 'pointer',
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
gap: '8px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path fillRule="evenodd" clipRule="evenodd" d="M10 2C5.582 2 2 4.91 2 8.5c0 2.26 1.37 4.25 3.44 5.44L4.6 17.1a.3.3 0 0 0 .44.33l4.03-2.67c.3.03.62.04.93.04 4.418 0 8-2.91 8-6.5S14.418 2 10 2z" fill="#3C1E1E"/>
|
||||||
|
</svg>
|
||||||
|
{t('loginPrompt.loginBtn')}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default LoginPromptModal;
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { SearchHistoryItem } from './useSearchHistory';
|
||||||
|
|
||||||
|
interface SearchHistoryDropdownProps {
|
||||||
|
items: SearchHistoryItem[];
|
||||||
|
onSelect: (item: SearchHistoryItem) => void;
|
||||||
|
onDelete: (e: React.MouseEvent, value: string) => void;
|
||||||
|
className?: string;
|
||||||
|
itemClassName?: string;
|
||||||
|
titleClassName?: string;
|
||||||
|
addressClassName?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const SearchHistoryDropdown: React.FC<SearchHistoryDropdownProps> = ({
|
||||||
|
items,
|
||||||
|
onSelect,
|
||||||
|
onDelete,
|
||||||
|
className = 'url-input-autocomplete-dropdown',
|
||||||
|
itemClassName = 'url-input-autocomplete-item',
|
||||||
|
titleClassName = 'url-input-autocomplete-title',
|
||||||
|
addressClassName = 'url-input-autocomplete-address',
|
||||||
|
}) => {
|
||||||
|
if (items.length === 0) return null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={className}>
|
||||||
|
{items.map((item, index) => (
|
||||||
|
<div
|
||||||
|
key={index}
|
||||||
|
className={itemClassName}
|
||||||
|
style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
style={{ flex: 1, textAlign: 'left', background: 'none', border: 'none', padding: 0, cursor: 'pointer' }}
|
||||||
|
onMouseDown={(e) => { e.preventDefault(); onSelect(item); }}
|
||||||
|
>
|
||||||
|
<div className={titleClassName}>{item.value}</div>
|
||||||
|
{item.roadAddress && (
|
||||||
|
<div className={addressClassName}>{item.roadAddress}</div>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onMouseDown={(e) => onDelete(e, item.value)}
|
||||||
|
style={{ color:'#737983', background: 'none', border: 'none', cursor: 'pointer', padding: '0 4px', opacity: 0.8, flexShrink: 0 }}
|
||||||
|
>
|
||||||
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3">
|
||||||
|
<line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default SearchHistoryDropdown;
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
import { useState, useEffect } from 'react';
|
||||||
|
|
||||||
|
export const SEARCH_HISTORY_KEY = 'castad_search_history';
|
||||||
|
export const SEARCH_HISTORY_MAX = 5;
|
||||||
|
|
||||||
|
export interface SearchHistoryItem {
|
||||||
|
type: 'url' | 'name';
|
||||||
|
value: string;
|
||||||
|
address?: string;
|
||||||
|
roadAddress?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const saveSearchHistory = (item: SearchHistoryItem) => {
|
||||||
|
try {
|
||||||
|
const saved = localStorage.getItem(SEARCH_HISTORY_KEY);
|
||||||
|
const history: SearchHistoryItem[] = saved ? JSON.parse(saved) : [];
|
||||||
|
const filtered = history.filter(h => h.value !== item.value);
|
||||||
|
const updated = [item, ...filtered].slice(0, SEARCH_HISTORY_MAX);
|
||||||
|
localStorage.setItem(SEARCH_HISTORY_KEY, JSON.stringify(updated));
|
||||||
|
} catch { /* ignore */ }
|
||||||
|
};
|
||||||
|
|
||||||
|
export const useSearchHistory = (searchType: 'url' | 'name') => {
|
||||||
|
const [history, setHistory] = useState<SearchHistoryItem[]>([]);
|
||||||
|
const [showHistory, setShowHistory] = useState(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
try {
|
||||||
|
const saved = localStorage.getItem(SEARCH_HISTORY_KEY);
|
||||||
|
if (saved) setHistory(JSON.parse(saved));
|
||||||
|
} catch { /* ignore */ }
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const filteredHistory = history.filter(h => h.type === searchType);
|
||||||
|
|
||||||
|
const deleteItem = (value: string) => {
|
||||||
|
const updated = history.filter(h => h.value !== value);
|
||||||
|
setHistory(updated);
|
||||||
|
localStorage.setItem(SEARCH_HISTORY_KEY, JSON.stringify(updated));
|
||||||
|
if (updated.filter(h => h.type === searchType).length === 0) {
|
||||||
|
setShowHistory(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const openHistory = (inputValue: string) => {
|
||||||
|
if (!inputValue && filteredHistory.length > 0) setShowHistory(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const closeHistory = () => setShowHistory(false);
|
||||||
|
|
||||||
|
const hideOnInput = (value: string) => {
|
||||||
|
if (value) setShowHistory(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
return { filteredHistory, showHistory, openHistory, closeHistory, hideOnInput, deleteItem };
|
||||||
|
};
|
||||||
@@ -0,0 +1,342 @@
|
|||||||
|
import React, { useState, useRef, useCallback, useEffect } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { searchAccommodation, AccommodationSearchItem, AutocompleteRequest } from '../utils/api';
|
||||||
|
import { useSearchHistory } from './SearchHistory/useSearchHistory';
|
||||||
|
import SearchHistoryDropdown from './SearchHistory/SearchHistoryDropdown';
|
||||||
|
import BusinessNameInputModal from './BusinessNameInputModal';
|
||||||
|
|
||||||
|
type SearchType = 'url' | 'name' | 'manual';
|
||||||
|
|
||||||
|
export type { SearchType };
|
||||||
|
|
||||||
|
const isValidUrl = (string: string): boolean => {
|
||||||
|
try {
|
||||||
|
const url = new URL(string);
|
||||||
|
return url.protocol === 'http:' || url.protocol === 'https:';
|
||||||
|
} catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
interface SearchInputFormProps {
|
||||||
|
onAnalyze?: (value: string, type: SearchType) => void;
|
||||||
|
onAutocomplete?: (data: AutocompleteRequest) => void;
|
||||||
|
onManualInput?: (businessName: string, address: string) => void;
|
||||||
|
/** 직접입력 버튼 클릭 시 기본 동작(모달 열기)을 대체합니다. 제공 시 모달을 직접 관리해야 합니다. */
|
||||||
|
onManualButtonClick?: () => void;
|
||||||
|
error?: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const SearchInputForm: React.FC<SearchInputFormProps> = ({
|
||||||
|
onAnalyze,
|
||||||
|
onAutocomplete,
|
||||||
|
onManualInput,
|
||||||
|
onManualButtonClick,
|
||||||
|
error: externalError,
|
||||||
|
}) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [inputValue, setInputValue] = useState('');
|
||||||
|
const [searchType, setSearchType] = useState<SearchType>('name');
|
||||||
|
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
||||||
|
const [isFocused, setIsFocused] = useState(false);
|
||||||
|
const [isManualModalOpen, setIsManualModalOpen] = useState(false);
|
||||||
|
const [localError, setLocalError] = useState('');
|
||||||
|
const [autocompleteResults, setAutocompleteResults] = useState<AccommodationSearchItem[]>([]);
|
||||||
|
const [isAutocompleteLoading, setIsAutocompleteLoading] = useState(false);
|
||||||
|
const [showAutocomplete, setShowAutocomplete] = useState(false);
|
||||||
|
const [selectedItem, setSelectedItem] = useState<AccommodationSearchItem | null>(null);
|
||||||
|
const [highlightedIndex, setHighlightedIndex] = useState<number>(-1);
|
||||||
|
|
||||||
|
const { filteredHistory, showHistory, openHistory, closeHistory, hideOnInput, deleteItem } = useSearchHistory(searchType === 'manual' ? 'name' : searchType);
|
||||||
|
const debounceRef = useRef<NodeJS.Timeout | null>(null);
|
||||||
|
const dropdownRef = useRef<HTMLDivElement>(null);
|
||||||
|
const autocompleteRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const handleClickOutside = (event: MouseEvent) => {
|
||||||
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) {
|
||||||
|
setIsDropdownOpen(false);
|
||||||
|
}
|
||||||
|
if (autocompleteRef.current && !autocompleteRef.current.contains(event.target as Node)) {
|
||||||
|
setShowAutocomplete(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
document.addEventListener('mousedown', handleClickOutside);
|
||||||
|
return () => document.removeEventListener('mousedown', handleClickOutside);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const searchTypeOptions = [
|
||||||
|
{ value: 'url' as SearchType, label: 'URL' },
|
||||||
|
{ value: 'name' as SearchType, label: t('landing.hero.searchTypeBusinessName') },
|
||||||
|
];
|
||||||
|
|
||||||
|
const getPlaceholder = () =>
|
||||||
|
searchType === 'url' ? 'https://naver.me/abcdef' : t('landing.hero.placeholderBusinessName');
|
||||||
|
|
||||||
|
const getGuideText = () =>
|
||||||
|
searchType === 'url' ? t('landing.hero.guideUrl') : t('landing.hero.guideBusinessName');
|
||||||
|
|
||||||
|
const handleAutocompleteSearch = useCallback(async (query: string) => {
|
||||||
|
if (!query.trim() || searchType !== 'name') {
|
||||||
|
setAutocompleteResults([]);
|
||||||
|
setShowAutocomplete(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setIsAutocompleteLoading(true);
|
||||||
|
try {
|
||||||
|
const response = await searchAccommodation(query);
|
||||||
|
setAutocompleteResults(response.items || []);
|
||||||
|
setShowAutocomplete(response.items && response.items.length > 0);
|
||||||
|
} catch {
|
||||||
|
setAutocompleteResults([]);
|
||||||
|
setShowAutocomplete(false);
|
||||||
|
} finally {
|
||||||
|
setIsAutocompleteLoading(false);
|
||||||
|
}
|
||||||
|
}, [searchType]);
|
||||||
|
|
||||||
|
const handleSelectAutocomplete = (item: AccommodationSearchItem) => {
|
||||||
|
setInputValue(item.title.replace(/<[^>]*>/g, ''));
|
||||||
|
setSelectedItem(item);
|
||||||
|
setShowAutocomplete(false);
|
||||||
|
setAutocompleteResults([]);
|
||||||
|
setHighlightedIndex(-1);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
||||||
|
if (showAutocomplete && autocompleteResults.length > 0) {
|
||||||
|
switch (e.key) {
|
||||||
|
case 'ArrowDown':
|
||||||
|
e.preventDefault();
|
||||||
|
setHighlightedIndex(prev => prev < autocompleteResults.length - 1 ? prev + 1 : 0);
|
||||||
|
return;
|
||||||
|
case 'ArrowUp':
|
||||||
|
e.preventDefault();
|
||||||
|
setHighlightedIndex(prev => prev > 0 ? prev - 1 : autocompleteResults.length - 1);
|
||||||
|
return;
|
||||||
|
case 'Enter':
|
||||||
|
e.preventDefault();
|
||||||
|
if (highlightedIndex >= 0 && highlightedIndex < autocompleteResults.length) {
|
||||||
|
handleSelectAutocomplete(autocompleteResults[highlightedIndex]);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
case 'Escape':
|
||||||
|
e.preventDefault();
|
||||||
|
setShowAutocomplete(false);
|
||||||
|
setHighlightedIndex(-1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleStart = () => {
|
||||||
|
if (!inputValue.trim()) {
|
||||||
|
setLocalError(searchType === 'url' ? t('landing.hero.errorUrlRequired') : t('landing.hero.errorNameRequired'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (searchType === 'url' && !isValidUrl(inputValue.trim())) {
|
||||||
|
setLocalError(t('landing.hero.errorInvalidUrl'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setLocalError('');
|
||||||
|
|
||||||
|
if (searchType === 'name' && selectedItem && onAutocomplete) {
|
||||||
|
onAutocomplete({
|
||||||
|
address: selectedItem.address,
|
||||||
|
roadAddress: selectedItem.roadAddress,
|
||||||
|
title: selectedItem.title,
|
||||||
|
});
|
||||||
|
} else if (onAnalyze) {
|
||||||
|
onAnalyze(inputValue, searchType);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleManualButtonClick = () => {
|
||||||
|
if (onManualButtonClick) {
|
||||||
|
onManualButtonClick();
|
||||||
|
} else {
|
||||||
|
setIsManualModalOpen(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const error = externalError || localError;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="hero-form">
|
||||||
|
<div className={`hero-input-wrapper ${isFocused ? 'focused' : ''} ${error ? 'error' : ''} ${inputValue && !isFocused ? 'filled' : ''}`}>
|
||||||
|
{/* 드롭다운 */}
|
||||||
|
<div className="hero-dropdown-container" ref={dropdownRef}>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="hero-dropdown-trigger"
|
||||||
|
onClick={() => setIsDropdownOpen(!isDropdownOpen)}
|
||||||
|
>
|
||||||
|
<span>{searchTypeOptions.find(opt => opt.value === searchType)?.label}</span>
|
||||||
|
<svg
|
||||||
|
width="12"
|
||||||
|
height="12"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
strokeWidth="2"
|
||||||
|
className={`hero-dropdown-arrow ${isDropdownOpen ? 'open' : ''}`}
|
||||||
|
>
|
||||||
|
<path d="M6 9l6 6 6-6" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
{isDropdownOpen && (
|
||||||
|
<div className="hero-dropdown-menu">
|
||||||
|
{searchTypeOptions.map((option) => (
|
||||||
|
<button
|
||||||
|
key={option.value}
|
||||||
|
type="button"
|
||||||
|
className={`hero-dropdown-item ${searchType === option.value ? 'active' : ''}`}
|
||||||
|
onClick={() => {
|
||||||
|
setSearchType(option.value);
|
||||||
|
setIsDropdownOpen(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{option.label}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* 입력 필드 */}
|
||||||
|
<div className="hero-input-container" ref={autocompleteRef}>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
value={inputValue}
|
||||||
|
onChange={(e) => {
|
||||||
|
let value = e.target.value;
|
||||||
|
if (searchType === 'url') {
|
||||||
|
const urlMatch = value.match(/https?:\/\/\S+/);
|
||||||
|
if (urlMatch && urlMatch[0] !== value) value = urlMatch[0];
|
||||||
|
}
|
||||||
|
setInputValue(value);
|
||||||
|
setSelectedItem(null);
|
||||||
|
setHighlightedIndex(-1);
|
||||||
|
hideOnInput(value);
|
||||||
|
if (localError) setLocalError('');
|
||||||
|
if (searchType === 'name') {
|
||||||
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
||||||
|
debounceRef.current = setTimeout(() => handleAutocompleteSearch(value), 300);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onPaste={(e: React.ClipboardEvent<HTMLInputElement>) => {
|
||||||
|
if (searchType !== 'url') return;
|
||||||
|
const pasted = e.clipboardData.getData('text');
|
||||||
|
const urlMatch = pasted.match(/https?:\/\/[^\s]+/);
|
||||||
|
if (urlMatch) {
|
||||||
|
e.preventDefault();
|
||||||
|
setInputValue(urlMatch[0]);
|
||||||
|
if (localError) setLocalError('');
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onFocus={() => {
|
||||||
|
setIsFocused(true);
|
||||||
|
if (searchType === 'name' && autocompleteResults.length > 0) setShowAutocomplete(true);
|
||||||
|
openHistory(inputValue);
|
||||||
|
}}
|
||||||
|
onBlur={() => { setIsFocused(false); setTimeout(() => closeHistory(), 150); }}
|
||||||
|
onKeyDown={handleKeyDown}
|
||||||
|
placeholder={getPlaceholder()}
|
||||||
|
className={`hero-input ${inputValue ? 'has-value' : ''}`}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{/* 최근 검색 히스토리 */}
|
||||||
|
{showHistory && !showAutocomplete && (
|
||||||
|
<SearchHistoryDropdown
|
||||||
|
items={filteredHistory}
|
||||||
|
onSelect={(item) => {
|
||||||
|
closeHistory();
|
||||||
|
if (item.type === 'url') {
|
||||||
|
setSearchType('url');
|
||||||
|
setInputValue(item.value);
|
||||||
|
} else {
|
||||||
|
setSearchType('name');
|
||||||
|
setInputValue(item.value);
|
||||||
|
setSelectedItem({ title: item.value, address: item.address || '', roadAddress: item.roadAddress || '' });
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onDelete={(e, value) => { e.preventDefault(); e.stopPropagation(); deleteItem(value); }}
|
||||||
|
className="hero-autocomplete-dropdown"
|
||||||
|
itemClassName="hero-autocomplete-item"
|
||||||
|
titleClassName="hero-autocomplete-title"
|
||||||
|
addressClassName="hero-autocomplete-address"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* 자동완성 결과 */}
|
||||||
|
{showAutocomplete && searchType === 'name' && (
|
||||||
|
<div className="hero-autocomplete-dropdown">
|
||||||
|
{isAutocompleteLoading ? (
|
||||||
|
<div className="hero-autocomplete-loading">{t('landing.hero.searching')}</div>
|
||||||
|
) : (
|
||||||
|
autocompleteResults.map((item, index) => (
|
||||||
|
<button
|
||||||
|
key={index}
|
||||||
|
type="button"
|
||||||
|
className={`hero-autocomplete-item ${highlightedIndex === index ? 'highlighted' : ''}`}
|
||||||
|
onMouseDown={(e) => { e.preventDefault(); handleSelectAutocomplete(item); }}
|
||||||
|
onMouseEnter={() => setHighlightedIndex(index)}
|
||||||
|
>
|
||||||
|
<div className="hero-autocomplete-title" dangerouslySetInnerHTML={{ __html: item.title }} />
|
||||||
|
<div className="hero-autocomplete-address">{item.roadAddress || item.address}</div>
|
||||||
|
</button>
|
||||||
|
))
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* 입력 clear 버튼 */}
|
||||||
|
{inputValue && (
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="hero-input-clear"
|
||||||
|
onClick={() => {
|
||||||
|
setInputValue('');
|
||||||
|
setSelectedItem(null);
|
||||||
|
setLocalError('');
|
||||||
|
setAutocompleteResults([]);
|
||||||
|
setShowAutocomplete(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<img src="/assets/images/input-clear-icon.svg" alt="Clear" />
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<span className="hero-input-hint">{getGuideText()}</span>
|
||||||
|
|
||||||
|
{error && <p className="hero-error">{error}</p>}
|
||||||
|
|
||||||
|
<button onClick={handleStart} className="hero-button">
|
||||||
|
{t('landing.hero.analyzeButton')}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button type="button" className="hero-manual-button" onClick={handleManualButtonClick}>
|
||||||
|
{t('landing.hero.searchTypeManual')}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
{/* onManualButtonClick 미제공 시 모달을 내부에서 관리 */}
|
||||||
|
{!onManualButtonClick && isManualModalOpen && (
|
||||||
|
<BusinessNameInputModal
|
||||||
|
onClose={() => setIsManualModalOpen(false)}
|
||||||
|
onSubmit={(businessName, address) => {
|
||||||
|
setIsManualModalOpen(false);
|
||||||
|
onManualInput?.(businessName, address);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default SearchInputForm;
|
||||||
@@ -12,11 +12,13 @@ interface SidebarItemProps {
|
|||||||
isCollapsed: boolean;
|
isCollapsed: boolean;
|
||||||
isDisabled?: boolean;
|
isDisabled?: boolean;
|
||||||
onClick?: () => void;
|
onClick?: () => void;
|
||||||
|
id?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SidebarItem: React.FC<SidebarItemProps> = ({ icon, label, isActive, isCollapsed, isDisabled, onClick }) => {
|
const SidebarItem: React.FC<SidebarItemProps> = ({ icon, label, isActive, isCollapsed, isDisabled, onClick, id }) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
id={id}
|
||||||
onClick={isDisabled ? undefined : onClick}
|
onClick={isDisabled ? undefined : onClick}
|
||||||
className={`sidebar-item ${isActive ? 'active' : ''} ${isCollapsed ? 'collapsed' : ''} ${isDisabled ? 'disabled' : ''}`}
|
className={`sidebar-item ${isActive ? 'active' : ''} ${isCollapsed ? 'collapsed' : ''} ${isDisabled ? 'disabled' : ''}`}
|
||||||
title={isCollapsed ? label : ""}
|
title={isCollapsed ? label : ""}
|
||||||
@@ -35,9 +37,13 @@ interface SidebarProps {
|
|||||||
onHome?: () => void;
|
onHome?: () => void;
|
||||||
userInfo?: UserMeResponse | null;
|
userInfo?: UserMeResponse | null;
|
||||||
onLogout?: () => void;
|
onLogout?: () => void;
|
||||||
|
credits?: number | null;
|
||||||
|
tutorialAvailable?: boolean;
|
||||||
|
tutorialEnabled?: boolean;
|
||||||
|
onToggleTutorial?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Sidebar: React.FC<SidebarProps> = ({ activeItem, onNavigate, onHome, userInfo, onLogout }) => {
|
const Sidebar: React.FC<SidebarProps> = ({ activeItem, onNavigate, onHome, userInfo, onLogout, credits, tutorialAvailable, tutorialEnabled, onToggleTutorial }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [isCollapsed, setIsCollapsed] = useState(false);
|
const [isCollapsed, setIsCollapsed] = useState(false);
|
||||||
const [isMobileOpen, setIsMobileOpen] = useState(false);
|
const [isMobileOpen, setIsMobileOpen] = useState(false);
|
||||||
@@ -82,8 +88,8 @@ const Sidebar: React.FC<SidebarProps> = ({ activeItem, onNavigate, onHome, userI
|
|||||||
{ id: '대시보드', label: t('sidebar.dashboard'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><rect x="3" y="3" width="7" height="9"/><rect x="14" y="3" width="7" height="5"/><rect x="14" y="12" width="7" height="9"/><rect x="3" y="16" width="7" height="5"/></svg> },
|
{ id: '대시보드', label: t('sidebar.dashboard'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><rect x="3" y="3" width="7" height="9"/><rect x="14" y="3" width="7" height="5"/><rect x="14" y="12" width="7" height="9"/><rect x="3" y="16" width="7" height="5"/></svg> },
|
||||||
{ id: '새 프로젝트 만들기', label: t('sidebar.newProject'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg> },
|
{ id: '새 프로젝트 만들기', label: t('sidebar.newProject'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg> },
|
||||||
{ id: 'ADO2 콘텐츠', label: t('sidebar.ado2Contents'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg> },
|
{ id: 'ADO2 콘텐츠', label: t('sidebar.ado2Contents'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg> },
|
||||||
{ id: '내 콘텐츠', label: t('sidebar.myContents'), disabled: true, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg> },
|
{ id: '내 콘텐츠', label: t('sidebar.myContents'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg> },
|
||||||
{ id: '콘텐츠 캘린더', label: '콘텐츠 캘린더', disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg> },
|
{ id: '콘텐츠 캘린더', label: t('contentCalendar.title'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg> },
|
||||||
{ id: '내 정보', label: t('sidebar.myInfo'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg> },
|
{ id: '내 정보', label: t('sidebar.myInfo'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg> },
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -138,6 +144,13 @@ const Sidebar: React.FC<SidebarProps> = ({ activeItem, onNavigate, onHome, userI
|
|||||||
{menuItems.map(item => (
|
{menuItems.map(item => (
|
||||||
<SidebarItem
|
<SidebarItem
|
||||||
key={item.id}
|
key={item.id}
|
||||||
|
id={
|
||||||
|
item.id === '내 정보'
|
||||||
|
? 'sidebar-my-info'
|
||||||
|
: item.id === 'ADO2 콘텐츠'
|
||||||
|
? 'sidebar-ado2-contents'
|
||||||
|
: undefined
|
||||||
|
}
|
||||||
icon={item.icon}
|
icon={item.icon}
|
||||||
label={item.label}
|
label={item.label}
|
||||||
isCollapsed={isCollapsed}
|
isCollapsed={isCollapsed}
|
||||||
@@ -149,6 +162,24 @@ const Sidebar: React.FC<SidebarProps> = ({ activeItem, onNavigate, onHome, userI
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="sidebar-footer">
|
<div className="sidebar-footer">
|
||||||
|
{/* 모바일 전용 튜토리얼 토글 */}
|
||||||
|
{tutorialAvailable && (
|
||||||
|
<button
|
||||||
|
className={`sidebar-tutorial-btn ${tutorialEnabled ? 'active' : ''}`}
|
||||||
|
onClick={() => onToggleTutorial?.()}
|
||||||
|
title={tutorialEnabled ? t('sidebar.tutorialOff') : t('sidebar.tutorialOn')}
|
||||||
|
>
|
||||||
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||||
|
<circle cx="12" cy="12" r="10"/>
|
||||||
|
<path d="M12 8v4l3 3"/>
|
||||||
|
</svg>
|
||||||
|
<span className="sidebar-tutorial-label">{t('sidebar.tutorial')}</span>
|
||||||
|
<span className={`sidebar-tutorial-badge ${tutorialEnabled ? 'on' : 'off'}`}>
|
||||||
|
{tutorialEnabled ? 'ON' : 'OFF'}
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
|
||||||
<div className="sidebar-language-switch">
|
<div className="sidebar-language-switch">
|
||||||
<LanguageSwitch isCollapsed={isCollapsed} />
|
<LanguageSwitch isCollapsed={isCollapsed} />
|
||||||
</div>
|
</div>
|
||||||
@@ -171,6 +202,9 @@ const Sidebar: React.FC<SidebarProps> = ({ activeItem, onNavigate, onHome, userI
|
|||||||
{!isCollapsed && (
|
{!isCollapsed && (
|
||||||
<div className="flex-1 min-w-0">
|
<div className="flex-1 min-w-0">
|
||||||
<p className="profile-name">{userInfo?.nickname || t('sidebar.defaultUser')}</p>
|
<p className="profile-name">{userInfo?.nickname || t('sidebar.defaultUser')}</p>
|
||||||
|
{credits !== null && credits !== undefined && (
|
||||||
|
<p className="profile-credits">{t('sidebar.credits', { count: credits })}</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -191,12 +225,12 @@ const Sidebar: React.FC<SidebarProps> = ({ activeItem, onNavigate, onHome, userI
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
className={`sidebar-inquiry-btn ${isCollapsed ? 'collapsed' : ''}`}
|
className={`sidebar-inquiry-btn ${isCollapsed ? 'collapsed' : ''}`}
|
||||||
title="고객의견"
|
title={t('sidebar.inquiry')}
|
||||||
>
|
>
|
||||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||||
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
|
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
|
||||||
</svg>
|
</svg>
|
||||||
{!isCollapsed && <span>고객의견</span>}
|
{!isCollapsed && <span>{t('sidebar.inquiry')}</span>}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,11 +4,15 @@ import { useTranslation } from 'react-i18next';
|
|||||||
import { getSocialAccounts, uploadToSocial, waitForUploadComplete, TokenExpiredError, handleSocialReconnect, getAutoSeoYoutube } from '../utils/api';
|
import { getSocialAccounts, uploadToSocial, waitForUploadComplete, TokenExpiredError, handleSocialReconnect, getAutoSeoYoutube } from '../utils/api';
|
||||||
import { SocialAccount, VideoListItem, SocialUploadStatusResponse } from '../types/api';
|
import { SocialAccount, VideoListItem, SocialUploadStatusResponse } from '../types/api';
|
||||||
import UploadProgressModal, { UploadStatus } from './UploadProgressModal';
|
import UploadProgressModal, { UploadStatus } from './UploadProgressModal';
|
||||||
|
import { useTutorial } from './Tutorial/useTutorial';
|
||||||
|
import { TUTORIAL_KEYS } from './Tutorial/tutorialSteps';
|
||||||
|
import TutorialOverlay from './Tutorial/TutorialOverlay';
|
||||||
|
|
||||||
interface SocialPostingModalProps {
|
interface SocialPostingModalProps {
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
video: VideoListItem | null;
|
video: VideoListItem | null;
|
||||||
|
onGoToCalendar?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
type PrivacyType = 'public' | 'unlisted' | 'private';
|
type PrivacyType = 'public' | 'unlisted' | 'private';
|
||||||
@@ -113,9 +117,11 @@ const MiniCalendar: React.FC<{
|
|||||||
const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
||||||
isOpen,
|
isOpen,
|
||||||
onClose,
|
onClose,
|
||||||
video
|
video,
|
||||||
|
onGoToCalendar,
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const tutorial = useTutorial();
|
||||||
const [socialAccounts, setSocialAccounts] = useState<SocialAccount[]>([]);
|
const [socialAccounts, setSocialAccounts] = useState<SocialAccount[]>([]);
|
||||||
const [selectedChannel, setSelectedChannel] = useState<string>('');
|
const [selectedChannel, setSelectedChannel] = useState<string>('');
|
||||||
const [title, setTitle] = useState('');
|
const [title, setTitle] = useState('');
|
||||||
@@ -132,9 +138,14 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
|||||||
const [isPrivacyDropdownOpen, setIsPrivacyDropdownOpen] = useState(false);
|
const [isPrivacyDropdownOpen, setIsPrivacyDropdownOpen] = useState(false);
|
||||||
const [isLoadingAutoDescription, setIsLoadingAutoDescription] = useState(false);
|
const [isLoadingAutoDescription, setIsLoadingAutoDescription] = useState(false);
|
||||||
const [isHorizontalVideo, setIsHorizontalVideo] = useState(false);
|
const [isHorizontalVideo, setIsHorizontalVideo] = useState(false);
|
||||||
const [videoSpecs, setVideoSpecs] = useState<{ resolution: string; duration: string } | null>(null);
|
const [videoMeta, setVideoMeta] = useState<{ width: number; height: number; duration: number } | null>(null);
|
||||||
const channelDropdownRef = useRef<HTMLDivElement>(null);
|
const channelDropdownRef = useRef<HTMLDivElement>(null);
|
||||||
const privacyDropdownRef = useRef<HTMLDivElement>(null);
|
const privacyDropdownRef = useRef<HTMLDivElement>(null);
|
||||||
|
const hasBeenOpenedRef = useRef(false);
|
||||||
|
const loadedForTaskIdRef = useRef<string | null>(null);
|
||||||
|
const loadedAtRef = useRef<number>(0);
|
||||||
|
const seoCache = useRef<Map<string, { title: string; description: string; tags: string }>>(new Map());
|
||||||
|
const SEO_CACHE_TTL = 50 * 60 * 1000;
|
||||||
|
|
||||||
// Upload progress modal state
|
// Upload progress modal state
|
||||||
const [showUploadProgress, setShowUploadProgress] = useState(false);
|
const [showUploadProgress, setShowUploadProgress] = useState(false);
|
||||||
@@ -145,6 +156,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
|||||||
// 업로드 정보 (모달이 닫힌 후에도 유지)
|
// 업로드 정보 (모달이 닫힌 후에도 유지)
|
||||||
const [uploadVideoTitle, setUploadVideoTitle] = useState<string>('');
|
const [uploadVideoTitle, setUploadVideoTitle] = useState<string>('');
|
||||||
const [uploadChannelName, setUploadChannelName] = useState<string>('');
|
const [uploadChannelName, setUploadChannelName] = useState<string>('');
|
||||||
|
const [uploadIsScheduled, setUploadIsScheduled] = useState(false);
|
||||||
|
|
||||||
// 드롭다운 외부 클릭 시 닫기
|
// 드롭다운 외부 클릭 시 닫기
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -171,19 +183,56 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
|||||||
return () => { document.body.style.overflow = ''; };
|
return () => { document.body.style.overflow = ''; };
|
||||||
}, [isOpen]);
|
}, [isOpen]);
|
||||||
|
|
||||||
// 소셜 계정 로드
|
// 모달 오픈/닫힘 시 튜토리얼 트리거
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isOpen) {
|
if (isOpen) {
|
||||||
loadSocialAccounts();
|
hasBeenOpenedRef.current = true;
|
||||||
loadAutocomplete();
|
if (!tutorial.hasSeen(TUTORIAL_KEYS.UPLOAD_MODAL)) {
|
||||||
// // 비디오 정보로 기본 제목 설정
|
const timer = setTimeout(() => {
|
||||||
// if (video) {
|
tutorial.startTutorial(TUTORIAL_KEYS.UPLOAD_MODAL);
|
||||||
// const date = new Date(video.created_at);
|
}, 400);
|
||||||
// const formattedDate = `${date.getFullYear()}.${String(date.getMonth() + 1).padStart(2, '0')}.${String(date.getDate()).padStart(2, '0')}`;
|
return () => clearTimeout(timer);
|
||||||
// setTitle(`${video.store_name} ${formattedDate}`);
|
}
|
||||||
// }
|
} else if (hasBeenOpenedRef.current && !tutorial.hasSeen(TUTORIAL_KEYS.FEEDBACK)) {
|
||||||
|
hasBeenOpenedRef.current = false;
|
||||||
|
tutorial.startTutorial(TUTORIAL_KEYS.FEEDBACK);
|
||||||
}
|
}
|
||||||
}, [isOpen, video]);
|
}, [isOpen]);
|
||||||
|
|
||||||
|
// SEO 생성 완료 시 UPLOAD_FORM 튜토리얼 트리거
|
||||||
|
useEffect(() => {
|
||||||
|
if (!isLoadingAutoDescription && isOpen && !tutorial.hasSeen(TUTORIAL_KEYS.UPLOAD_FORM)) {
|
||||||
|
const timer = setTimeout(() => {
|
||||||
|
tutorial.startTutorial(TUTORIAL_KEYS.UPLOAD_FORM);
|
||||||
|
}, 400);
|
||||||
|
return () => clearTimeout(timer);
|
||||||
|
}
|
||||||
|
}, [isLoadingAutoDescription]);
|
||||||
|
|
||||||
|
// 소셜 계정 로드
|
||||||
|
useEffect(() => {
|
||||||
|
if (!isOpen) return;
|
||||||
|
|
||||||
|
const now = Date.now();
|
||||||
|
|
||||||
|
loadSocialAccounts();
|
||||||
|
|
||||||
|
const taskId = video?.task_id ?? null;
|
||||||
|
const expired = now - loadedAtRef.current > SEO_CACHE_TTL;
|
||||||
|
|
||||||
|
if (taskId && (taskId !== loadedForTaskIdRef.current || expired)) {
|
||||||
|
loadedForTaskIdRef.current = taskId;
|
||||||
|
loadedAtRef.current = now;
|
||||||
|
loadAutocomplete();
|
||||||
|
} else if (taskId) {
|
||||||
|
const cached = seoCache.current.get(taskId);
|
||||||
|
if (cached) {
|
||||||
|
setTitle(cached.title);
|
||||||
|
setDescription(cached.description);
|
||||||
|
setTags(cached.tags);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [isOpen, video?.task_id]);
|
||||||
|
|
||||||
const loadSocialAccounts = async () => {
|
const loadSocialAccounts = async () => {
|
||||||
setIsLoadingAccounts(true);
|
setIsLoadingAccounts(true);
|
||||||
@@ -192,7 +241,9 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
|||||||
const activeAccounts = response.accounts?.filter(acc => acc.is_active) || [];
|
const activeAccounts = response.accounts?.filter(acc => acc.is_active) || [];
|
||||||
setSocialAccounts(activeAccounts);
|
setSocialAccounts(activeAccounts);
|
||||||
if (activeAccounts.length > 0) {
|
if (activeAccounts.length > 0) {
|
||||||
setSelectedChannel(activeAccounts[0].platform_user_id);
|
const lastUsed = localStorage.getItem('lastUsedSocialChannel');
|
||||||
|
const defaultAccount = activeAccounts.find(acc => acc.platform_user_id === lastUsed) || activeAccounts[0];
|
||||||
|
setSelectedChannel(defaultAccount.platform_user_id);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error instanceof TokenExpiredError) {
|
if (error instanceof TokenExpiredError) {
|
||||||
@@ -222,6 +273,11 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
|||||||
if (autoSeoResponse.title) setTitle(autoSeoResponse.title);
|
if (autoSeoResponse.title) setTitle(autoSeoResponse.title);
|
||||||
if (autoSeoResponse.description) setDescription(autoSeoResponse.description);
|
if (autoSeoResponse.description) setDescription(autoSeoResponse.description);
|
||||||
if (autoSeoResponse.keywords) setTags(autoSeoResponse.keywords.join(','));
|
if (autoSeoResponse.keywords) setTags(autoSeoResponse.keywords.join(','));
|
||||||
|
seoCache.current.set(video.task_id, {
|
||||||
|
title: autoSeoResponse.title || '',
|
||||||
|
description: autoSeoResponse.description || '',
|
||||||
|
tags: autoSeoResponse.keywords?.join(',') || '',
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to load autocomplete:', error);
|
console.error('Failed to load autocomplete:', error);
|
||||||
// 실패해도 사용자에게 별도 알림 없이 조용히 처리
|
// 실패해도 사용자에게 별도 알림 없이 조용히 처리
|
||||||
@@ -273,6 +329,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
|||||||
// 업로드 정보 저장 (모달이 닫힌 후에도 유지)
|
// 업로드 정보 저장 (모달이 닫힌 후에도 유지)
|
||||||
setUploadVideoTitle(title.trim());
|
setUploadVideoTitle(title.trim());
|
||||||
setUploadChannelName(selectedAcc.display_name);
|
setUploadChannelName(selectedAcc.display_name);
|
||||||
|
setUploadIsScheduled(publishTime === 'schedule');
|
||||||
setShowUploadProgress(true);
|
setShowUploadProgress(true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -310,6 +367,8 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
|||||||
throw new Error(uploadResponse.message || t('social.uploadStartFailed'));
|
throw new Error(uploadResponse.message || t('social.uploadStartFailed'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
localStorage.setItem('lastUsedSocialChannel', selectedAcc.platform_user_id);
|
||||||
|
|
||||||
if (publishTime === 'schedule') {
|
if (publishTime === 'schedule') {
|
||||||
// 예약 업로드: 폴링 없이 바로 완료 처리
|
// 예약 업로드: 폴링 없이 바로 완료 처리
|
||||||
setUploadStatus('completed');
|
setUploadStatus('completed');
|
||||||
@@ -372,6 +431,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
|||||||
setUploadErrorMessage(undefined);
|
setUploadErrorMessage(undefined);
|
||||||
setUploadVideoTitle('');
|
setUploadVideoTitle('');
|
||||||
setUploadChannelName('');
|
setUploadChannelName('');
|
||||||
|
setUploadIsScheduled(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
@@ -400,13 +460,27 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
|||||||
channelName={uploadChannelName || selectedAccount?.display_name || ''}
|
channelName={uploadChannelName || selectedAccount?.display_name || ''}
|
||||||
youtubeUrl={uploadYoutubeUrl}
|
youtubeUrl={uploadYoutubeUrl}
|
||||||
errorMessage={uploadErrorMessage}
|
errorMessage={uploadErrorMessage}
|
||||||
isScheduled={publishTime === 'schedule'}
|
isScheduled={uploadIsScheduled}
|
||||||
|
onGoToCalendar={onGoToCalendar}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!isOpen || !video) {
|
if (!isOpen || !video) {
|
||||||
// Still render upload progress modal even when main modal is closed
|
return (
|
||||||
return showUploadProgress ? uploadProgressModalElement : null;
|
<>
|
||||||
|
{showUploadProgress && uploadProgressModalElement}
|
||||||
|
{tutorial.isActive && (
|
||||||
|
<TutorialOverlay
|
||||||
|
hints={tutorial.hints}
|
||||||
|
currentIndex={tutorial.currentHintIndex}
|
||||||
|
onNext={tutorial.nextHint}
|
||||||
|
onPrev={tutorial.prevHint}
|
||||||
|
onSkip={tutorial.skipTutorial}
|
||||||
|
groupProgress={tutorial.groupProgress}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -437,10 +511,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
|||||||
onLoadedMetadata={(e) => {
|
onLoadedMetadata={(e) => {
|
||||||
const v = e.currentTarget;
|
const v = e.currentTarget;
|
||||||
setIsHorizontalVideo(v.videoWidth > v.videoHeight);
|
setIsHorizontalVideo(v.videoWidth > v.videoHeight);
|
||||||
const totalSec = Math.floor(v.duration);
|
setVideoMeta({ width: v.videoWidth, height: v.videoHeight, duration: v.duration });
|
||||||
const m = Math.floor(totalSec / 60).toString().padStart(2, '0');
|
|
||||||
const s = (totalSec % 60).toString().padStart(2, '0');
|
|
||||||
setVideoSpecs({ resolution: `${v.videoWidth}×${v.videoHeight}`, duration: `${m}:${s}` });
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -449,18 +520,20 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
|||||||
{/* Right: Form */}
|
{/* Right: Form */}
|
||||||
<div className="social-posting-form">
|
<div className="social-posting-form">
|
||||||
{/* Video Info */}
|
{/* Video Info */}
|
||||||
<div className="social-posting-video-info">
|
{/* <div className="social-posting-video-info">
|
||||||
<span className="social-posting-label-badge">{t('social.postNumber')}</span>
|
<span className="social-posting-label-badge">{t('social.postNumber')}</span>
|
||||||
<span className="social-posting-add-btn">+</span>
|
<span className="social-posting-add-btn">+</span>
|
||||||
</div>
|
</div> */}
|
||||||
|
|
||||||
<div className="social-posting-video-meta">
|
<div className="social-posting-video-meta">
|
||||||
<p className="social-posting-video-title">
|
<p className="social-posting-video-title">
|
||||||
{video.store_name} {new Date(video.created_at).toLocaleString('ko-KR')}
|
{video.store_name} {new Date(video.created_at).toLocaleString('ko-KR')}
|
||||||
</p>
|
</p>
|
||||||
{videoSpecs && (
|
<p className="social-posting-video-specs">
|
||||||
<p className="social-posting-video-specs">{videoSpecs.resolution} · {videoSpecs.duration}</p>
|
{videoMeta
|
||||||
)}
|
? `${videoMeta.width}×${videoMeta.height} · ${Math.floor(videoMeta.duration / 60)}:${String(Math.floor(videoMeta.duration % 60)).padStart(2, '0')}`
|
||||||
|
: t('social.videoSpecs')}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Channel Selector - Custom Dropdown */}
|
{/* Channel Selector - Custom Dropdown */}
|
||||||
@@ -483,7 +556,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
|||||||
onClick={() => setIsChannelDropdownOpen(!isChannelDropdownOpen)}
|
onClick={() => setIsChannelDropdownOpen(!isChannelDropdownOpen)}
|
||||||
>
|
>
|
||||||
<div className="social-posting-channel-selected">
|
<div className="social-posting-channel-selected">
|
||||||
{selectedAccount && (
|
{selectedAccount ? (
|
||||||
<>
|
<>
|
||||||
<img
|
<img
|
||||||
src={getPlatformIcon(selectedAccount.platform)}
|
src={getPlatformIcon(selectedAccount.platform)}
|
||||||
@@ -492,6 +565,8 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
|||||||
/>
|
/>
|
||||||
<span>{selectedAccount.display_name}</span>
|
<span>{selectedAccount.display_name}</span>
|
||||||
</>
|
</>
|
||||||
|
) : (
|
||||||
|
<span className="social-posting-channel-placeholder">{t('social.selectChannel')}</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<svg className="social-posting-channel-arrow" viewBox="0 0 12 8" fill="none">
|
<svg className="social-posting-channel-arrow" viewBox="0 0 12 8" fill="none">
|
||||||
@@ -529,48 +604,60 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
|||||||
<label className="social-posting-label">
|
<label className="social-posting-label">
|
||||||
{t('social.postTitleLabel')} <span className="required">*</span>
|
{t('social.postTitleLabel')} <span className="required">*</span>
|
||||||
</label>
|
</label>
|
||||||
<input
|
<div className="seo-input-wrapper">
|
||||||
type="text"
|
<input
|
||||||
value={title}
|
type="text"
|
||||||
onChange={(e) => setTitle(e.target.value)}
|
value={title}
|
||||||
placeholder={isLoadingAutoDescription ? t('social.autoSeoTitle') : t('social.postTitlePlaceholder')}
|
onChange={(e) => setTitle(e.target.value)}
|
||||||
// placeholder={t('social.postTitlePlaceholder')}
|
placeholder={isLoadingAutoDescription ? '' : t('social.postTitlePlaceholder')}
|
||||||
className="social-posting-input"
|
className="social-posting-input"
|
||||||
maxLength={100}
|
maxLength={100}
|
||||||
disabled={isLoadingAutoDescription}
|
disabled={isLoadingAutoDescription}
|
||||||
/>
|
/>
|
||||||
|
{isLoadingAutoDescription && (
|
||||||
|
<span className="seo-shimmer-text">{t('social.autoSeoTitle')}</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
<span className="social-posting-char-count">{title.length}/100</span>
|
<span className="social-posting-char-count">{title.length}/100</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Description */}
|
{/* Description */}
|
||||||
<div className="social-posting-field">
|
<div className="social-posting-field">
|
||||||
<label className="social-posting-label">{t('social.postContentLabel')}</label>
|
<label className="social-posting-label">{t('social.postContentLabel')}</label>
|
||||||
<textarea
|
<div className="seo-input-wrapper">
|
||||||
value={description}
|
<textarea
|
||||||
onChange={(e) => setDescription(e.target.value)}
|
value={description}
|
||||||
placeholder={t(isLoadingAutoDescription ? t('social.autoSeoDescription') : t('social.postContentPlaceholder'))}
|
onChange={(e) => setDescription(e.target.value)}
|
||||||
// placeholder={t('social.postContentPlaceholder')}
|
placeholder={isLoadingAutoDescription ? '' : t('social.postContentPlaceholder')}
|
||||||
className="social-posting-textarea"
|
className="social-posting-textarea"
|
||||||
maxLength={5000}
|
maxLength={5000}
|
||||||
rows={4}
|
rows={4}
|
||||||
disabled={isLoadingAutoDescription}
|
disabled={isLoadingAutoDescription}
|
||||||
/>
|
/>
|
||||||
|
{isLoadingAutoDescription && (
|
||||||
|
<span className="seo-shimmer-text">{t('social.autoSeoDescription')}</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
<span className="social-posting-char-count">{description.length}/5,000</span>
|
<span className="social-posting-char-count">{description.length}/5,000</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Tags */}
|
{/* Tags */}
|
||||||
<div className="social-posting-field">
|
<div className="social-posting-field">
|
||||||
<label className="social-posting-label">{t('social.tagsLabel')}</label>
|
<label className="social-posting-label">{t('social.tagsLabel')}</label>
|
||||||
<input
|
<div className="seo-input-wrapper">
|
||||||
type="text"
|
<input
|
||||||
value={tags}
|
type="text"
|
||||||
onChange={(e) => setTags(e.target.value)}
|
value={tags}
|
||||||
placeholder={t(isLoadingAutoDescription ? t('social.autoSeoTags') : t('social.tagsPlaceholder'))}
|
onChange={(e) => setTags(e.target.value)}
|
||||||
// placeholder={t('social.tagsPlaceholder')}
|
placeholder={isLoadingAutoDescription ? '' : t('social.tagsPlaceholder')}
|
||||||
className="social-posting-input"
|
className="social-posting-input"
|
||||||
maxLength={500}
|
maxLength={500}
|
||||||
disabled={isLoadingAutoDescription}
|
disabled={isLoadingAutoDescription}
|
||||||
/>
|
/>
|
||||||
|
{isLoadingAutoDescription && (
|
||||||
|
<span className="seo-shimmer-text">{t('social.autoSeoTags')}</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
<span className="social-posting-char-count">{tags.length}/500</span>
|
<span className="social-posting-char-count">{tags.length}/500</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -768,6 +855,16 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{uploadProgressModalElement}
|
{uploadProgressModalElement}
|
||||||
|
{tutorial.isActive && (
|
||||||
|
<TutorialOverlay
|
||||||
|
hints={tutorial.hints}
|
||||||
|
currentIndex={tutorial.currentHintIndex}
|
||||||
|
onNext={tutorial.nextHint}
|
||||||
|
onPrev={tutorial.prevHint}
|
||||||
|
onSkip={tutorial.skipTutorial}
|
||||||
|
groupProgress={tutorial.groupProgress}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,314 @@
|
|||||||
|
import React, { useEffect, useState, useCallback } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { TutorialHint } from './tutorialSteps';
|
||||||
|
|
||||||
|
interface Rect {
|
||||||
|
top: number;
|
||||||
|
left: number;
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
bottom: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface TooltipPos {
|
||||||
|
top: number;
|
||||||
|
left: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface TutorialOverlayProps {
|
||||||
|
hints: TutorialHint[];
|
||||||
|
currentIndex: number;
|
||||||
|
onNext: () => void;
|
||||||
|
onPrev: () => void;
|
||||||
|
onSkip: () => void;
|
||||||
|
groupProgress?: { groupTotal: number; groupOffset: number; isLastKeyInGroup: boolean } | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const PADDING = 8;
|
||||||
|
|
||||||
|
function getTargetRect(selector: string): Rect | null {
|
||||||
|
const els = Array.from(document.querySelectorAll(selector));
|
||||||
|
const el = els.find(e => {
|
||||||
|
const r = (e as HTMLElement).getBoundingClientRect();
|
||||||
|
return r.width > 0 && r.height > 0;
|
||||||
|
}) ?? els[0];
|
||||||
|
if (!el) return null;
|
||||||
|
const r = el.getBoundingClientRect();
|
||||||
|
return { top: r.top, left: r.left, width: r.width, height: r.height, bottom: r.bottom };
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSpotlightRect(
|
||||||
|
rect: Rect,
|
||||||
|
padding: number,
|
||||||
|
override?: { top?: number; right?: number; bottom?: number; left?: number }
|
||||||
|
): Rect {
|
||||||
|
const pTop = override?.top ?? padding;
|
||||||
|
const pRight = override?.right ?? padding;
|
||||||
|
const pBottom = override?.bottom ?? padding;
|
||||||
|
const pLeft = override?.left ?? padding;
|
||||||
|
const left = Math.max(0, Math.floor(rect.left - pLeft));
|
||||||
|
const top = Math.max(0, Math.floor(rect.top - pTop));
|
||||||
|
const right = Math.min(window.innerWidth, Math.ceil(rect.left + rect.width + pRight));
|
||||||
|
const bottom = Math.min(window.innerHeight, Math.ceil(rect.top + rect.height + pBottom));
|
||||||
|
|
||||||
|
return {
|
||||||
|
top,
|
||||||
|
bottom,
|
||||||
|
left,
|
||||||
|
width: Math.max(0, right - left),
|
||||||
|
height: Math.max(0, bottom - top),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function calcTooltipPos(rect: Rect, position: TutorialHint['position'], tooltipW = 300, tooltipH = 160): TooltipPos {
|
||||||
|
|
||||||
|
switch (position) {
|
||||||
|
case 'bottom':
|
||||||
|
return {
|
||||||
|
top: Math.min(rect.top + rect.height + PADDING, window.innerHeight - tooltipH - 8),
|
||||||
|
left: Math.min(Math.max(rect.left + rect.width / 2 - tooltipW / 2, 8), window.innerWidth - tooltipW - 8),
|
||||||
|
};
|
||||||
|
case 'top':
|
||||||
|
return {
|
||||||
|
top: Math.max(rect.top - tooltipH - PADDING, 8),
|
||||||
|
left: Math.min(Math.max(rect.left + rect.width / 2 - tooltipW / 2, 8), window.innerWidth - tooltipW - 8),
|
||||||
|
};
|
||||||
|
case 'right':
|
||||||
|
return {
|
||||||
|
top: Math.min(Math.max(rect.top + rect.height / 2 - tooltipH / 2, 8), window.innerHeight - tooltipH - 8),
|
||||||
|
left: Math.min(rect.left + rect.width + PADDING, window.innerWidth - tooltipW - 8),
|
||||||
|
};
|
||||||
|
case 'left':
|
||||||
|
return {
|
||||||
|
top: Math.min(Math.max(rect.top + rect.height / 2 - tooltipH / 2, 8), window.innerHeight - tooltipH - 8),
|
||||||
|
left: Math.max(rect.left - tooltipW - PADDING, 8),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const TutorialOverlay: React.FC<TutorialOverlayProps> = ({
|
||||||
|
hints,
|
||||||
|
currentIndex,
|
||||||
|
onNext,
|
||||||
|
onPrev,
|
||||||
|
onSkip,
|
||||||
|
groupProgress,
|
||||||
|
}) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [targetRect, setTargetRect] = useState<Rect | null>(null);
|
||||||
|
const tooltipRef = React.useRef<HTMLDivElement>(null);
|
||||||
|
const [tooltipSize, setTooltipSize] = useState({ w: 300, h: 160 });
|
||||||
|
|
||||||
|
const hint = hints[currentIndex];
|
||||||
|
const isLast = currentIndex === hints.length - 1;
|
||||||
|
// 그룹이 있으면 그룹의 마지막 키 + 마지막 힌트일 때만 완료, 그룹 없으면 기존대로
|
||||||
|
const isFinish = isLast && (groupProgress ? groupProgress.isLastKeyInGroup : true);
|
||||||
|
|
||||||
|
const updateRect = useCallback(() => {
|
||||||
|
if (!hint) return;
|
||||||
|
setTargetRect(getTargetRect(hint.targetSelector));
|
||||||
|
}, [hint]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
updateRect();
|
||||||
|
window.addEventListener('resize', updateRect);
|
||||||
|
window.addEventListener('scroll', updateRect, true);
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener('resize', updateRect);
|
||||||
|
window.removeEventListener('scroll', updateRect, true);
|
||||||
|
};
|
||||||
|
}, [updateRect]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!hint) return;
|
||||||
|
let retryTimer: number | undefined;
|
||||||
|
let rectTimer: number | undefined;
|
||||||
|
let cleanupTarget: (() => void) | undefined;
|
||||||
|
|
||||||
|
const bindToTarget = (el: HTMLElement) => {
|
||||||
|
el.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||||
|
rectTimer = window.setTimeout(updateRect, 200);
|
||||||
|
|
||||||
|
const shouldClickAdvance = hint.clickToAdvance !== false;
|
||||||
|
if (shouldClickAdvance) {
|
||||||
|
el.style.cursor = 'pointer';
|
||||||
|
el.addEventListener('click', onNext);
|
||||||
|
cleanupTarget = () => {
|
||||||
|
el.style.cursor = '';
|
||||||
|
el.removeEventListener('click', onNext);
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
cleanupTarget = () => {};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const tryBind = (): boolean => {
|
||||||
|
const els = Array.from(document.querySelectorAll(hint.targetSelector));
|
||||||
|
const el = (els.find(e => {
|
||||||
|
const r = (e as HTMLElement).getBoundingClientRect();
|
||||||
|
return r.width > 0 && r.height > 0;
|
||||||
|
}) ?? els[0]) as HTMLElement | null;
|
||||||
|
if (!el) return false;
|
||||||
|
bindToTarget(el);
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!tryBind()) {
|
||||||
|
retryTimer = window.setInterval(() => {
|
||||||
|
if (tryBind() && retryTimer) {
|
||||||
|
window.clearInterval(retryTimer);
|
||||||
|
retryTimer = undefined;
|
||||||
|
}
|
||||||
|
}, 80);
|
||||||
|
}
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
if (retryTimer) window.clearInterval(retryTimer);
|
||||||
|
if (rectTimer) window.clearTimeout(rectTimer);
|
||||||
|
cleanupTarget?.();
|
||||||
|
};
|
||||||
|
}, [hint, updateRect, onNext]);
|
||||||
|
|
||||||
|
// 툴팁 DOM 크기 측정 — 힌트가 바뀔 때만 재측정
|
||||||
|
useEffect(() => {
|
||||||
|
const el = tooltipRef.current;
|
||||||
|
if (!el) return;
|
||||||
|
const { offsetWidth, offsetHeight } = el;
|
||||||
|
if (offsetWidth && offsetHeight) {
|
||||||
|
setTooltipSize(prev =>
|
||||||
|
prev.w === offsetWidth && prev.h === offsetHeight
|
||||||
|
? prev
|
||||||
|
: { w: offsetWidth, h: offsetHeight }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}, [currentIndex, hints]);
|
||||||
|
|
||||||
|
if (!hint) return null;
|
||||||
|
|
||||||
|
const isTargetVisible = targetRect
|
||||||
|
? targetRect.top + 60 < window.innerHeight && targetRect.bottom > 60
|
||||||
|
: true;
|
||||||
|
|
||||||
|
if (!isTargetVisible) return null;
|
||||||
|
|
||||||
|
const spotlightPadding = hint.spotlightPadding ?? PADDING;
|
||||||
|
const spotlightRect = (targetRect && !hint.noSpotlight) ? getSpotlightRect(targetRect, spotlightPadding, hint.spotlightPaddingOverride) : null;
|
||||||
|
|
||||||
|
// 툴팁은 spotlightRect 기준으로 배치해야 스포트라이트와 겹치지 않음
|
||||||
|
const tooltipPos: TooltipPos = (spotlightRect ?? targetRect)
|
||||||
|
? calcTooltipPos((spotlightRect ?? targetRect)!, hint.position, tooltipSize.w, tooltipSize.h)
|
||||||
|
: {
|
||||||
|
top: window.innerHeight / 2 - tooltipSize.h / 2,
|
||||||
|
left: window.innerWidth / 2 - tooltipSize.w / 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="tutorial-overlay-root">
|
||||||
|
{spotlightRect ? (
|
||||||
|
<>
|
||||||
|
<div
|
||||||
|
className="tutorial-overlay-blocker"
|
||||||
|
style={{ top: 0, left: 0, right: 0, height: spotlightRect.top }}
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
className="tutorial-overlay-blocker"
|
||||||
|
style={{
|
||||||
|
top: spotlightRect.top,
|
||||||
|
left: 0,
|
||||||
|
width: spotlightRect.left,
|
||||||
|
height: spotlightRect.height,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
className="tutorial-overlay-blocker"
|
||||||
|
style={{
|
||||||
|
top: spotlightRect.top,
|
||||||
|
left: spotlightRect.left + spotlightRect.width,
|
||||||
|
right: 0,
|
||||||
|
height: spotlightRect.height,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
className="tutorial-overlay-blocker"
|
||||||
|
style={{
|
||||||
|
top: spotlightRect.top + spotlightRect.height,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
bottom: 0,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
className="tutorial-spotlight-ring"
|
||||||
|
style={{
|
||||||
|
top: spotlightRect.top,
|
||||||
|
left: spotlightRect.left,
|
||||||
|
width: spotlightRect.width,
|
||||||
|
height: spotlightRect.height,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
) : null}
|
||||||
|
|
||||||
|
<div
|
||||||
|
ref={tooltipRef}
|
||||||
|
className={`tutorial-tooltip${hint.variant === 'bubble' ? ` tutorial-tooltip-bubble tutorial-tooltip-bubble--${hint.position}` : ''}`}
|
||||||
|
style={{ top: tooltipPos.top, left: tooltipPos.left }}
|
||||||
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
>
|
||||||
|
<p className="tutorial-tooltip-title">{t(hint.titleKey)}</p>
|
||||||
|
<p className="tutorial-tooltip-desc">{t(hint.descriptionKey)}</p>
|
||||||
|
{hint.noteKey && (
|
||||||
|
<p className="tutorial-tooltip-note">{t(hint.noteKey)}</p>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div className="tutorial-tooltip-footer">
|
||||||
|
<span className="tutorial-tooltip-counter">
|
||||||
|
{groupProgress ? groupProgress.groupOffset + 1 : currentIndex + 1} / {groupProgress ? groupProgress.groupTotal : hints.length}
|
||||||
|
</span>
|
||||||
|
<div className="tutorial-tooltip-actions">
|
||||||
|
<button className="tutorial-btn-skip" onClick={onSkip}>
|
||||||
|
{t('tutorial.skip')}
|
||||||
|
</button>
|
||||||
|
{currentIndex > 0 && (
|
||||||
|
<button className="tutorial-btn-prev" onClick={onPrev}>
|
||||||
|
{t('tutorial.prev')}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
{(hint.clickToAdvance !== true || isFinish) && (
|
||||||
|
<button className="tutorial-btn-next" onClick={onNext}>
|
||||||
|
{isFinish ? t('tutorial.finish') : t('tutorial.next')}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default TutorialOverlay;
|
||||||
|
|
||||||
|
interface TutorialRestartPopupProps {
|
||||||
|
onConfirm: () => void;
|
||||||
|
onCancel: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const TutorialRestartPopup: React.FC<TutorialRestartPopupProps> = ({ onConfirm, onCancel }) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
return (
|
||||||
|
<div className="tutorial-restart-backdrop">
|
||||||
|
<div className="tutorial-restart-popup" onClick={(e) => e.stopPropagation()}>
|
||||||
|
<p className="tutorial-restart-title">{t('tutorial.restart.title')}</p>
|
||||||
|
<p className="tutorial-restart-desc">{t('tutorial.restart.desc')}</p>
|
||||||
|
<div className="tutorial-restart-actions">
|
||||||
|
<button className="tutorial-restart-cancel" onClick={onCancel}>
|
||||||
|
{t('tutorial.restart.cancel')}
|
||||||
|
</button>
|
||||||
|
<button className="tutorial-restart-confirm" onClick={onConfirm}>
|
||||||
|
{t('tutorial.restart.confirm')}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,386 @@
|
|||||||
|
export interface TutorialHint {
|
||||||
|
targetSelector: string;
|
||||||
|
titleKey: string;
|
||||||
|
descriptionKey: string;
|
||||||
|
position: 'top' | 'bottom' | 'left' | 'right';
|
||||||
|
noteKey?: string;
|
||||||
|
variant?: 'bubble';
|
||||||
|
clickToAdvance?: boolean;
|
||||||
|
advanceSelector?: string;
|
||||||
|
noSpotlight?: boolean;
|
||||||
|
spotlightPadding?: number;
|
||||||
|
spotlightPaddingOverride?: { top?: number; right?: number; bottom?: number; left?: number };
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TutorialStepDef {
|
||||||
|
key: string;
|
||||||
|
hints: TutorialHint[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export const TUTORIAL_KEYS = {
|
||||||
|
LANDING: 'landing',
|
||||||
|
ANALYSIS: 'analysis',
|
||||||
|
ASSET: 'asset',
|
||||||
|
SOUND: 'sound',
|
||||||
|
SOUND_LYRICS: 'soundLyrics',
|
||||||
|
SOUND_AUDIO: 'soundAudio',
|
||||||
|
GENERATING:'generating',
|
||||||
|
COMPLETION: 'completion',
|
||||||
|
MY_INFO: 'myInfo',
|
||||||
|
ADO2_CONTENTS: 'ado2Contents',
|
||||||
|
UPLOAD_MODAL: 'uploadModal',
|
||||||
|
UPLOAD_FORM: 'uploadForm',
|
||||||
|
DASHBOARD: 'dashboard',
|
||||||
|
CONTENT_CALENDAR: 'contentCalendar',
|
||||||
|
FEEDBACK: 'feedback',
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
// 같은 페이지에 속하는 튜토리얼 키 그룹 — 진행 카운터를 합산해서 표시
|
||||||
|
export const TUTORIAL_PAGE_GROUPS: string[][] = [
|
||||||
|
[TUTORIAL_KEYS.SOUND, TUTORIAL_KEYS.SOUND_LYRICS, TUTORIAL_KEYS.SOUND_AUDIO],
|
||||||
|
[TUTORIAL_KEYS.GENERATING, TUTORIAL_KEYS.COMPLETION],
|
||||||
|
[TUTORIAL_KEYS.UPLOAD_MODAL, TUTORIAL_KEYS.UPLOAD_FORM],
|
||||||
|
];
|
||||||
|
|
||||||
|
export const tutorialSteps: TutorialStepDef[] = [
|
||||||
|
{
|
||||||
|
key: TUTORIAL_KEYS.LANDING,
|
||||||
|
hints: [
|
||||||
|
{
|
||||||
|
targetSelector: '.hero-dropdown-trigger',
|
||||||
|
titleKey: 'tutorial.landing.dropdown.title',
|
||||||
|
descriptionKey: 'tutorial.landing.dropdown.desc',
|
||||||
|
position: 'top',
|
||||||
|
clickToAdvance: false,
|
||||||
|
noSpotlight: true,
|
||||||
|
variant: 'bubble',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '.hero-input-wrapper',
|
||||||
|
titleKey: 'tutorial.landing.field.title',
|
||||||
|
descriptionKey: 'tutorial.landing.field.desc',
|
||||||
|
position: 'top',
|
||||||
|
clickToAdvance: false,
|
||||||
|
noSpotlight: true,
|
||||||
|
variant: 'bubble',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '.hero-manual-button',
|
||||||
|
titleKey: 'tutorial.landing.manual.title',
|
||||||
|
descriptionKey: 'tutorial.landing.manual.desc',
|
||||||
|
position: 'bottom',
|
||||||
|
clickToAdvance: false,
|
||||||
|
noSpotlight: true,
|
||||||
|
variant: 'bubble',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '.hero-button',
|
||||||
|
titleKey: 'tutorial.landing.button.title',
|
||||||
|
descriptionKey: 'tutorial.landing.button.desc',
|
||||||
|
position: 'bottom',
|
||||||
|
clickToAdvance: true,
|
||||||
|
noSpotlight: true,
|
||||||
|
variant: 'bubble',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: TUTORIAL_KEYS.ASSET,
|
||||||
|
hints: [
|
||||||
|
{
|
||||||
|
targetSelector: '.asset-column.asset-column-left',
|
||||||
|
titleKey: 'tutorial.asset.image.title',
|
||||||
|
descriptionKey: 'tutorial.asset.image.desc',
|
||||||
|
position: 'left',
|
||||||
|
clickToAdvance: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '.asset-upload-zone, .asset-mobile-upload-btn',
|
||||||
|
titleKey: 'tutorial.asset.upload.title',
|
||||||
|
descriptionKey: 'tutorial.asset.upload.desc',
|
||||||
|
position: 'bottom',
|
||||||
|
clickToAdvance: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '.asset-ratio-section',
|
||||||
|
titleKey: 'tutorial.asset.ratio.title',
|
||||||
|
descriptionKey: 'tutorial.asset.ratio.desc',
|
||||||
|
position: 'top',
|
||||||
|
clickToAdvance: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '.asset-next-button',
|
||||||
|
titleKey: 'tutorial.asset.next.title',
|
||||||
|
descriptionKey: 'tutorial.asset.next.desc',
|
||||||
|
position: 'top',
|
||||||
|
clickToAdvance: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: TUTORIAL_KEYS.SOUND,
|
||||||
|
hints: [
|
||||||
|
{
|
||||||
|
targetSelector: '.genre-grid',
|
||||||
|
titleKey: 'tutorial.sound.genre.title',
|
||||||
|
descriptionKey: 'tutorial.sound.genre.desc',
|
||||||
|
position: 'top',
|
||||||
|
clickToAdvance: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '.language-grid',
|
||||||
|
titleKey: 'tutorial.sound.language.title',
|
||||||
|
descriptionKey: 'tutorial.sound.language.desc',
|
||||||
|
position: 'top',
|
||||||
|
clickToAdvance: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '.btn-generate-sound',
|
||||||
|
titleKey: 'tutorial.sound.generate.title',
|
||||||
|
descriptionKey: 'tutorial.sound.generate.desc',
|
||||||
|
position: 'top',
|
||||||
|
clickToAdvance: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: TUTORIAL_KEYS.SOUND_LYRICS,
|
||||||
|
hints: [
|
||||||
|
{
|
||||||
|
targetSelector: '.lyrics-display',
|
||||||
|
titleKey: 'tutorial.sound.lyrics.title',
|
||||||
|
descriptionKey: 'tutorial.sound.lyrics.desc',
|
||||||
|
position: 'top',
|
||||||
|
clickToAdvance: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '.status-message-new',
|
||||||
|
titleKey: 'tutorial.sound.lyricsWait.title',
|
||||||
|
descriptionKey: 'tutorial.sound.lyricsWait.desc',
|
||||||
|
position: 'top',
|
||||||
|
clickToAdvance: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: TUTORIAL_KEYS.SOUND_AUDIO,
|
||||||
|
hints: [
|
||||||
|
{
|
||||||
|
targetSelector: '.audio-player',
|
||||||
|
titleKey: 'tutorial.sound.audioPlayer.title',
|
||||||
|
descriptionKey: 'tutorial.sound.audioPlayer.desc',
|
||||||
|
position: 'bottom',
|
||||||
|
clickToAdvance: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '.btn-video-generate',
|
||||||
|
titleKey: 'tutorial.sound.video.title',
|
||||||
|
descriptionKey: 'tutorial.sound.video.desc',
|
||||||
|
position: 'top',
|
||||||
|
clickToAdvance: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: TUTORIAL_KEYS.MY_INFO,
|
||||||
|
hints: [
|
||||||
|
{
|
||||||
|
targetSelector: '.youtube-connect-section',
|
||||||
|
titleKey: 'tutorial.myInfo.myInfo.title',
|
||||||
|
descriptionKey: 'tutorial.myInfo.myInfo.desc',
|
||||||
|
position: 'top',
|
||||||
|
clickToAdvance: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '.myinfo-social-btn',
|
||||||
|
titleKey: 'tutorial.myInfo.connect.title',
|
||||||
|
descriptionKey: 'tutorial.myInfo.connect.desc',
|
||||||
|
noteKey: 'tutorial.myInfo.connect.note',
|
||||||
|
position: 'top',
|
||||||
|
clickToAdvance: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '.myinfo-connected-accounts',
|
||||||
|
titleKey: 'tutorial.myInfo.connected.title',
|
||||||
|
descriptionKey: 'tutorial.myInfo.connected.desc',
|
||||||
|
position: 'top',
|
||||||
|
clickToAdvance: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '#sidebar-ado2-contents',
|
||||||
|
titleKey: 'tutorial.myInfo.ado2.title',
|
||||||
|
descriptionKey: 'tutorial.myInfo.ado2.desc',
|
||||||
|
position: 'right',
|
||||||
|
clickToAdvance: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: TUTORIAL_KEYS.ADO2_CONTENTS,
|
||||||
|
hints: [
|
||||||
|
{
|
||||||
|
targetSelector: '.ado2-content-card',
|
||||||
|
titleKey: 'tutorial.ado2.list.title',
|
||||||
|
descriptionKey: 'tutorial.ado2.list.desc',
|
||||||
|
position: 'right',
|
||||||
|
clickToAdvance: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '.content-upload-btn',
|
||||||
|
titleKey: 'tutorial.ado2.download.title',
|
||||||
|
descriptionKey: 'tutorial.ado2.download.desc',
|
||||||
|
position: 'top',
|
||||||
|
clickToAdvance: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '.content-delete-btn',
|
||||||
|
titleKey: 'tutorial.ado2.delete.title',
|
||||||
|
descriptionKey: 'tutorial.ado2.delete.desc',
|
||||||
|
position: 'top',
|
||||||
|
clickToAdvance: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '.content-download-btn',
|
||||||
|
titleKey: 'tutorial.ado2.upload.title',
|
||||||
|
descriptionKey: 'tutorial.ado2.upload.desc',
|
||||||
|
position: 'top',
|
||||||
|
clickToAdvance: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: TUTORIAL_KEYS.GENERATING,
|
||||||
|
hints:[
|
||||||
|
{
|
||||||
|
targetSelector: '.comp2-info-section',
|
||||||
|
titleKey: 'tutorial.completion.contentInfo.title',
|
||||||
|
descriptionKey: 'tutorial.completion.contentInfo.desc',
|
||||||
|
position: 'left',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '.comp2-video-section',
|
||||||
|
titleKey: 'tutorial.completion.generating.title',
|
||||||
|
descriptionKey: 'tutorial.completion.generating.desc',
|
||||||
|
position: 'top',
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: TUTORIAL_KEYS.COMPLETION,
|
||||||
|
hints: [
|
||||||
|
{
|
||||||
|
targetSelector: '.comp2-video-section',
|
||||||
|
titleKey: 'tutorial.completion.completion.title',
|
||||||
|
descriptionKey: 'tutorial.completion.completion.desc',
|
||||||
|
position: 'top',
|
||||||
|
clickToAdvance: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '#sidebar-my-info',
|
||||||
|
titleKey: 'tutorial.completion.myInfo.title',
|
||||||
|
descriptionKey: 'tutorial.completion.myInfo.desc',
|
||||||
|
position: 'right',
|
||||||
|
clickToAdvance: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: TUTORIAL_KEYS.UPLOAD_MODAL,
|
||||||
|
hints: [
|
||||||
|
{
|
||||||
|
targetSelector: '.social-posting-content',
|
||||||
|
titleKey: 'tutorial.upload.seo.title',
|
||||||
|
descriptionKey: 'tutorial.upload.seo.desc',
|
||||||
|
position: 'right',
|
||||||
|
clickToAdvance: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: TUTORIAL_KEYS.UPLOAD_FORM,
|
||||||
|
hints: [
|
||||||
|
{
|
||||||
|
targetSelector: '.social-posting-form',
|
||||||
|
titleKey: 'tutorial.upload.required.title',
|
||||||
|
descriptionKey: 'tutorial.upload.required.desc',
|
||||||
|
position: 'top',
|
||||||
|
clickToAdvance: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '.social-posting-radio-group',
|
||||||
|
titleKey: 'tutorial.upload.schedule.title',
|
||||||
|
descriptionKey: 'tutorial.upload.schedule.desc',
|
||||||
|
position: 'top',
|
||||||
|
clickToAdvance: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '.social-posting-btn:not(.cancel)',
|
||||||
|
titleKey: 'tutorial.upload.submit.title',
|
||||||
|
descriptionKey: 'tutorial.upload.submit.desc',
|
||||||
|
position: 'top',
|
||||||
|
clickToAdvance: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: TUTORIAL_KEYS.DASHBOARD,
|
||||||
|
hints: [
|
||||||
|
{
|
||||||
|
targetSelector: '.stats-grid-8',
|
||||||
|
titleKey: 'tutorial.dashboard.metrics.title',
|
||||||
|
descriptionKey: 'tutorial.dashboard.metrics.desc',
|
||||||
|
position: 'bottom',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '.yoy-chart-card',
|
||||||
|
titleKey: 'tutorial.dashboard.chart.title',
|
||||||
|
descriptionKey: 'tutorial.dashboard.chart.desc',
|
||||||
|
position: 'top',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '.tutorial-center-anchor',
|
||||||
|
titleKey: 'tutorial.dashboard.more.title',
|
||||||
|
descriptionKey: 'tutorial.dashboard.more.desc',
|
||||||
|
position: 'bottom',
|
||||||
|
clickToAdvance: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: TUTORIAL_KEYS.CONTENT_CALENDAR,
|
||||||
|
hints: [
|
||||||
|
{
|
||||||
|
targetSelector: '.calendar-grid-area',
|
||||||
|
titleKey: 'tutorial.contentCalendar.grid.title',
|
||||||
|
descriptionKey: 'tutorial.contentCalendar.grid.desc',
|
||||||
|
position: 'top',
|
||||||
|
clickToAdvance: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '.calendar-side-panel',
|
||||||
|
titleKey: 'tutorial.contentCalendar.panel.title',
|
||||||
|
descriptionKey: 'tutorial.contentCalendar.panel.desc',
|
||||||
|
position: 'left',
|
||||||
|
clickToAdvance: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: TUTORIAL_KEYS.FEEDBACK,
|
||||||
|
hints: [
|
||||||
|
{
|
||||||
|
targetSelector: '.tutorial-center-anchor',
|
||||||
|
titleKey: 'tutorial.feedback.complete.title',
|
||||||
|
descriptionKey: 'tutorial.feedback.complete.desc',
|
||||||
|
position: 'bottom',
|
||||||
|
clickToAdvance: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetSelector: '.sidebar-inquiry-btn',
|
||||||
|
titleKey: 'tutorial.feedback.title',
|
||||||
|
descriptionKey: 'tutorial.feedback.desc',
|
||||||
|
position: 'right',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
@@ -0,0 +1,220 @@
|
|||||||
|
import React, { useState, useCallback, useEffect } from 'react';
|
||||||
|
import { tutorialSteps, TutorialHint, TUTORIAL_PAGE_GROUPS } from './tutorialSteps';
|
||||||
|
|
||||||
|
// 현재 키가 속한 그룹의 전체 힌트 수와 현재까지의 offset 반환
|
||||||
|
function getGroupProgress(key: string, currentIndex: number): { groupTotal: number; groupOffset: number; isLastKeyInGroup: boolean } | null {
|
||||||
|
const group = TUTORIAL_PAGE_GROUPS.find(g => g.includes(key));
|
||||||
|
if (!group) return null;
|
||||||
|
let offset = 0;
|
||||||
|
let total = 0;
|
||||||
|
for (const k of group) {
|
||||||
|
const step = tutorialSteps.find(s => s.key === k);
|
||||||
|
const count = step?.hints.length ?? 0;
|
||||||
|
if (k === key) offset = total;
|
||||||
|
total += count;
|
||||||
|
}
|
||||||
|
const isLastKeyInGroup = group[group.length - 1] === key;
|
||||||
|
return { groupTotal: total, groupOffset: offset + currentIndex, isLastKeyInGroup };
|
||||||
|
}
|
||||||
|
|
||||||
|
const SEEN_KEY = 'ado2_tutorial_seen';
|
||||||
|
const PROGRESS_KEY = 'ado2_tutorial_progress';
|
||||||
|
const ENABLED_KEY = 'ado2_tutorial_enabled';
|
||||||
|
|
||||||
|
// 전역 단일 활성 튜토리얼 관리 — 새 튜토리얼 시작 시 이전 것을 skip 처리
|
||||||
|
let globalSkip: (() => void) | null = null;
|
||||||
|
|
||||||
|
function getSeenKeys(): string[] {
|
||||||
|
try {
|
||||||
|
return JSON.parse(localStorage.getItem(SEEN_KEY) || '[]');
|
||||||
|
} catch {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function markSeen(key: string) {
|
||||||
|
const seen = getSeenKeys();
|
||||||
|
if (!seen.includes(key)) {
|
||||||
|
localStorage.setItem(SEEN_KEY, JSON.stringify([...seen, key]));
|
||||||
|
}
|
||||||
|
clearProgress(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
function saveProgress(key: string, index: number) {
|
||||||
|
try {
|
||||||
|
const progress = JSON.parse(localStorage.getItem(PROGRESS_KEY) || '{}');
|
||||||
|
progress[key] = index;
|
||||||
|
localStorage.setItem(PROGRESS_KEY, JSON.stringify(progress));
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadProgress(key: string): number {
|
||||||
|
try {
|
||||||
|
const progress = JSON.parse(localStorage.getItem(PROGRESS_KEY) || '{}');
|
||||||
|
return progress[key] ?? 0;
|
||||||
|
} catch {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearProgress(key: string) {
|
||||||
|
try {
|
||||||
|
const progress = JSON.parse(localStorage.getItem(PROGRESS_KEY) || '{}');
|
||||||
|
delete progress[key];
|
||||||
|
localStorage.setItem(PROGRESS_KEY, JSON.stringify(progress));
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
interface UseTutorialReturn {
|
||||||
|
isActive: boolean;
|
||||||
|
isEnabled: boolean;
|
||||||
|
isRestartPopupVisible: boolean;
|
||||||
|
currentHintIndex: number;
|
||||||
|
hints: TutorialHint[];
|
||||||
|
tutorialKey: string | null;
|
||||||
|
groupProgress: { groupTotal: number; groupOffset: number; isLastKeyInGroup: boolean } | null;
|
||||||
|
startTutorial: (key: string, onComplete?: () => void, forceFromStart?: boolean) => void;
|
||||||
|
nextHint: () => void;
|
||||||
|
prevHint: () => void;
|
||||||
|
skipTutorial: () => void;
|
||||||
|
toggleTutorial: (currentKey: string | null) => void;
|
||||||
|
showRestartPopup: (key: string) => void;
|
||||||
|
confirmRestart: () => void;
|
||||||
|
cancelRestart: () => void;
|
||||||
|
hasSeen: (key: string) => boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useTutorial(): UseTutorialReturn {
|
||||||
|
const [isActive, setIsActive] = useState(false);
|
||||||
|
const [isEnabled, setIsEnabled] = useState(() => localStorage.getItem(ENABLED_KEY) !== 'false');
|
||||||
|
const [isRestartPopupVisible, setIsRestartPopupVisible] = useState(false);
|
||||||
|
const [pendingRestartKey, setPendingRestartKey] = useState<string | null>(null);
|
||||||
|
const [currentHintIndex, setCurrentHintIndex] = useState(0);
|
||||||
|
const [hints, setHints] = useState<TutorialHint[]>([]);
|
||||||
|
const [tutorialKey, setTutorialKey] = useState<string | null>(null);
|
||||||
|
const onCompleteRef = React.useRef<(() => void) | undefined>(undefined);
|
||||||
|
|
||||||
|
const startTutorial = useCallback((key: string, onComplete?: () => void, forceFromStart?: boolean) => {
|
||||||
|
if (localStorage.getItem(ENABLED_KEY) === 'false') return;
|
||||||
|
const step = tutorialSteps.find(s => s.key === key);
|
||||||
|
if (!step || step.hints.length === 0) return;
|
||||||
|
// 다른 인스턴스에서 활성화된 튜토리얼이 있으면 skip 처리
|
||||||
|
globalSkip?.();
|
||||||
|
const savedIndex = forceFromStart ? 0 : loadProgress(key);
|
||||||
|
const resumeIndex = savedIndex < step.hints.length ? savedIndex : 0;
|
||||||
|
onCompleteRef.current = onComplete;
|
||||||
|
setHints(step.hints);
|
||||||
|
setTutorialKey(key);
|
||||||
|
setCurrentHintIndex(resumeIndex);
|
||||||
|
setIsActive(true);
|
||||||
|
// 이 인스턴스의 skip을 전역에 등록
|
||||||
|
globalSkip = () => {
|
||||||
|
if (key) saveProgress(key, resumeIndex);
|
||||||
|
setIsActive(false);
|
||||||
|
setCurrentHintIndex(0);
|
||||||
|
globalSkip = null;
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const nextHint = useCallback(() => {
|
||||||
|
setCurrentHintIndex(prev => {
|
||||||
|
if (prev < hints.length - 1) {
|
||||||
|
const next = prev + 1;
|
||||||
|
if (tutorialKey) saveProgress(tutorialKey, next);
|
||||||
|
return next;
|
||||||
|
}
|
||||||
|
// 마지막 힌트 완료 → seen 기록 + 진행 상태 삭제
|
||||||
|
setIsActive(false);
|
||||||
|
if (tutorialKey) markSeen(tutorialKey);
|
||||||
|
globalSkip = null; // 완료된 튜토리얼은 globalSkip 해제
|
||||||
|
onCompleteRef.current?.();
|
||||||
|
onCompleteRef.current = undefined;
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
}, [hints.length, tutorialKey]);
|
||||||
|
|
||||||
|
const prevHint = useCallback(() => {
|
||||||
|
setCurrentHintIndex(prev => Math.max(0, prev - 1));
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// 건너뛰기: 현재 진행 인덱스 저장 후 오버레이 닫기 → 다음 방문 시 이어서 표시
|
||||||
|
const skipTutorial = useCallback(() => {
|
||||||
|
if (tutorialKey) saveProgress(tutorialKey, currentHintIndex);
|
||||||
|
setIsActive(false);
|
||||||
|
setCurrentHintIndex(0);
|
||||||
|
}, [tutorialKey, currentHintIndex]);
|
||||||
|
|
||||||
|
const toggleTutorial = useCallback((currentKey: string | null) => {
|
||||||
|
if (isEnabled) {
|
||||||
|
// off: 튜토리얼 중단 + 비활성화
|
||||||
|
setIsActive(false);
|
||||||
|
setIsEnabled(false);
|
||||||
|
localStorage.setItem(ENABLED_KEY, 'false');
|
||||||
|
} else {
|
||||||
|
// on: seen/progress 초기화 + 현재 화면 튜토리얼 시작
|
||||||
|
localStorage.removeItem(SEEN_KEY);
|
||||||
|
localStorage.removeItem(PROGRESS_KEY);
|
||||||
|
localStorage.setItem(ENABLED_KEY, 'true');
|
||||||
|
setIsEnabled(true);
|
||||||
|
if (currentKey) {
|
||||||
|
startTutorial(currentKey, undefined, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [isEnabled, startTutorial]);
|
||||||
|
|
||||||
|
// 튜토리얼 다시 보기: 팝업 표시만
|
||||||
|
const showRestartPopup = useCallback((key: string) => {
|
||||||
|
setPendingRestartKey(key);
|
||||||
|
setIsRestartPopupVisible(true);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// 팝업에서 확인 → seen/progress 초기화 후 튜토리얼 시작
|
||||||
|
const confirmRestart = useCallback(() => {
|
||||||
|
setIsRestartPopupVisible(false);
|
||||||
|
if (pendingRestartKey) {
|
||||||
|
localStorage.removeItem(SEEN_KEY);
|
||||||
|
localStorage.removeItem(PROGRESS_KEY);
|
||||||
|
startTutorial(pendingRestartKey, undefined, true);
|
||||||
|
}
|
||||||
|
setPendingRestartKey(null);
|
||||||
|
}, [pendingRestartKey, startTutorial]);
|
||||||
|
|
||||||
|
// 팝업에서 취소
|
||||||
|
const cancelRestart = useCallback(() => {
|
||||||
|
setIsRestartPopupVisible(false);
|
||||||
|
setPendingRestartKey(null);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const hasSeen = useCallback((key: string) => {
|
||||||
|
return getSeenKeys().includes(key);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// 영상 보유 사용자 자동 off 이벤트 수신
|
||||||
|
useEffect(() => {
|
||||||
|
const handler = () => {
|
||||||
|
setIsActive(false);
|
||||||
|
setIsEnabled(false);
|
||||||
|
};
|
||||||
|
window.addEventListener('ado2-tutorial-auto-disable', handler);
|
||||||
|
return () => window.removeEventListener('ado2-tutorial-auto-disable', handler);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return {
|
||||||
|
isActive,
|
||||||
|
isEnabled,
|
||||||
|
isRestartPopupVisible,
|
||||||
|
currentHintIndex,
|
||||||
|
hints,
|
||||||
|
tutorialKey,
|
||||||
|
groupProgress: tutorialKey ? getGroupProgress(tutorialKey, currentHintIndex) : null,
|
||||||
|
startTutorial,
|
||||||
|
nextHint,
|
||||||
|
prevHint,
|
||||||
|
skipTutorial,
|
||||||
|
toggleTutorial,
|
||||||
|
showRestartPopup,
|
||||||
|
confirmRestart,
|
||||||
|
cancelRestart,
|
||||||
|
hasSeen,
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -14,6 +14,7 @@ interface UploadProgressModalProps {
|
|||||||
youtubeUrl?: string;
|
youtubeUrl?: string;
|
||||||
errorMessage?: string;
|
errorMessage?: string;
|
||||||
isScheduled?: boolean;
|
isScheduled?: boolean;
|
||||||
|
onGoToCalendar?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const UploadProgressModal: React.FC<UploadProgressModalProps> = ({
|
const UploadProgressModal: React.FC<UploadProgressModalProps> = ({
|
||||||
@@ -26,6 +27,7 @@ const UploadProgressModal: React.FC<UploadProgressModalProps> = ({
|
|||||||
youtubeUrl,
|
youtubeUrl,
|
||||||
errorMessage,
|
errorMessage,
|
||||||
isScheduled = false,
|
isScheduled = false,
|
||||||
|
onGoToCalendar,
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
if (!isOpen) return null;
|
if (!isOpen) return null;
|
||||||
@@ -151,9 +153,16 @@ const UploadProgressModal: React.FC<UploadProgressModalProps> = ({
|
|||||||
{/* Footer */}
|
{/* Footer */}
|
||||||
<div className="upload-progress-footer">
|
<div className="upload-progress-footer">
|
||||||
{canClose ? (
|
{canClose ? (
|
||||||
<button className="upload-progress-btn primary" onClick={onClose}>
|
<>
|
||||||
{status === 'completed' ? t('upload.confirm') : t('upload.close')}
|
<button className="upload-progress-btn primary" onClick={onClose}>
|
||||||
</button>
|
{status === 'completed' ? t('upload.confirm') : t('upload.close')}
|
||||||
|
</button>
|
||||||
|
{status === 'completed' && onGoToCalendar && (
|
||||||
|
<span className="upload-progress-calendar-link" onClick={() => { onClose(); onGoToCalendar(); }}>
|
||||||
|
{t('upload.goToCalendar')}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
) : (
|
) : (
|
||||||
<p className="upload-progress-note">{t('upload.doNotClose')}</p>
|
<p className="upload-progress-note">{t('upload.doNotClose')}</p>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -0,0 +1,485 @@
|
|||||||
|
import React, { useState, useEffect, useCallback, useRef } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import {
|
||||||
|
getVideoById,
|
||||||
|
getVideoComments,
|
||||||
|
postVideoComment,
|
||||||
|
deleteComment,
|
||||||
|
toggleVideoLike,
|
||||||
|
isLoggedIn,
|
||||||
|
} from '../utils/api';
|
||||||
|
import { VideoDetailItem, CommentItem } from '../types/api';
|
||||||
|
import LoginPromptModal from './LoginPromptModal';
|
||||||
|
|
||||||
|
interface VideoDetailContentProps {
|
||||||
|
videoId: string;
|
||||||
|
isModal?: boolean;
|
||||||
|
onClose?: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModal = false, onClose }) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const authed = isLoggedIn();
|
||||||
|
|
||||||
|
const [video, setVideo] = useState<VideoDetailItem | null>(null);
|
||||||
|
const [loading, setLoading] = useState(true);
|
||||||
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
|
||||||
|
const [likeCount, setLikeCount] = useState(0);
|
||||||
|
const [isLiked, setIsLiked] = useState(false);
|
||||||
|
|
||||||
|
const [copied, setCopied] = useState(false);
|
||||||
|
const [shareMenuOpen, setShareMenuOpen] = useState(false);
|
||||||
|
const [isLandscape, setIsLandscape] = useState(false);
|
||||||
|
const [showLoginModal, setShowLoginModal] = useState(false);
|
||||||
|
|
||||||
|
const [comments, setComments] = useState<CommentItem[]>([]);
|
||||||
|
const [commentsTotal, setCommentsTotal] = useState(0);
|
||||||
|
const [commentsPage, setCommentsPage] = useState(1);
|
||||||
|
const [commentsHasNext, setCommentsHasNext] = useState(false);
|
||||||
|
const [commentsLoading, setCommentsLoading] = useState(false);
|
||||||
|
const [commentInput, setCommentInput] = useState('');
|
||||||
|
const [commentSubmitting, setCommentSubmitting] = useState(false);
|
||||||
|
const commentTextareaRef = useRef<HTMLTextAreaElement>(null);
|
||||||
|
|
||||||
|
const [commentNickname, setCommentNickname] = useState('');
|
||||||
|
const [commentAvatarSeedIdx, setCommentAvatarSeedIdx] = useState(0);
|
||||||
|
|
||||||
|
// 고정 seed 목록: 브라우저가 캐싱하여 중복 요청 없음
|
||||||
|
const AVATAR_SEEDS = ['42', '77', '123', '256', '512', '888', '1024', '2048', '3141', '9999'];
|
||||||
|
const commentAvatarSeed = AVATAR_SEEDS[commentAvatarSeedIdx % AVATAR_SEEDS.length];
|
||||||
|
|
||||||
|
const handleChangeAvatar = useCallback(() => {
|
||||||
|
setCommentAvatarSeedIdx(prev => (prev + 1) % AVATAR_SEEDS.length);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const fetchComments = useCallback(async (page: number, append = false) => {
|
||||||
|
setCommentsLoading(true);
|
||||||
|
try {
|
||||||
|
const res = await getVideoComments(videoId, page, 20);
|
||||||
|
const sorted = [...res.items].sort(
|
||||||
|
(a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime()
|
||||||
|
);
|
||||||
|
setComments(prev => append ? [...prev, ...sorted] : sorted);
|
||||||
|
setCommentsTotal(res.total);
|
||||||
|
setCommentsHasNext(res.has_next);
|
||||||
|
setCommentsPage(page);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to fetch comments:', err);
|
||||||
|
} finally {
|
||||||
|
setCommentsLoading(false);
|
||||||
|
}
|
||||||
|
}, [videoId]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const fetchVideo = async () => {
|
||||||
|
setLoading(true);
|
||||||
|
setError(null);
|
||||||
|
try {
|
||||||
|
const data = await getVideoById(videoId);
|
||||||
|
setVideo(data);
|
||||||
|
setLikeCount(data.like_count);
|
||||||
|
setIsLiked(data.is_liked_by_me);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to fetch video:', err);
|
||||||
|
setError(t('ado2Contents.loadFailed'));
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
fetchVideo();
|
||||||
|
fetchComments(1);
|
||||||
|
}, [videoId, fetchComments]);
|
||||||
|
|
||||||
|
const formatDate = (dateString: string) => {
|
||||||
|
const date = new Date(dateString);
|
||||||
|
return `${date.getFullYear()}년 ${date.getMonth() + 1}월 ${date.getDate()}일`;
|
||||||
|
};
|
||||||
|
|
||||||
|
const formatCommentDate = (dateString: string) => {
|
||||||
|
const date = new Date(dateString);
|
||||||
|
return `${date.getFullYear()}.${String(date.getMonth() + 1).padStart(2, '0')}.${String(date.getDate()).padStart(2, '0')}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
const shareUrl = `${window.location.origin}/video/${videoId}`;
|
||||||
|
|
||||||
|
const handleCopyLink = async () => {
|
||||||
|
try {
|
||||||
|
await navigator.clipboard.writeText(shareUrl);
|
||||||
|
} catch {
|
||||||
|
// clipboard API 미지원 환경에서는 무시
|
||||||
|
}
|
||||||
|
setCopied(true);
|
||||||
|
setTimeout(() => setCopied(false), 2000);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleKakaoShare = () => {
|
||||||
|
const kakao = window.Kakao;
|
||||||
|
if (kakao?.Share) {
|
||||||
|
kakao.Share.sendDefault({
|
||||||
|
objectType: 'feed',
|
||||||
|
content: {
|
||||||
|
title: video?.store_name ?? 'ADO2 영상',
|
||||||
|
description: `${video?.region ?? ''} · ADO2 AI 마케팅 영상`,
|
||||||
|
imageUrl: 'https://demo.castad.net/favicon_48.svg',
|
||||||
|
link: { mobileWebUrl: shareUrl, webUrl: shareUrl },
|
||||||
|
},
|
||||||
|
buttons: [{ title: '영상 보기', link: { mobileWebUrl: shareUrl, webUrl: shareUrl } }],
|
||||||
|
});
|
||||||
|
} else if (navigator.share) {
|
||||||
|
navigator.share({ url: shareUrl }).catch(() => {});
|
||||||
|
} else {
|
||||||
|
handleCopyLink();
|
||||||
|
}
|
||||||
|
setShareMenuOpen(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleFacebookShare = () => {
|
||||||
|
window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(shareUrl)}`, '_blank', 'noopener,width=600,height=600');
|
||||||
|
setShareMenuOpen(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleTwitterShare = () => {
|
||||||
|
window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(shareUrl)}`, '_blank', 'noopener,width=600,height=600');
|
||||||
|
setShareMenuOpen(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
const shareMenuRef = React.useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!shareMenuOpen) return;
|
||||||
|
const handleClickOutside = (e: MouseEvent) => {
|
||||||
|
if (shareMenuRef.current && !shareMenuRef.current.contains(e.target as Node)) {
|
||||||
|
setShareMenuOpen(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
document.addEventListener('mousedown', handleClickOutside);
|
||||||
|
return () => document.removeEventListener('mousedown', handleClickOutside);
|
||||||
|
}, [shareMenuOpen]);
|
||||||
|
|
||||||
|
const likeDebounceRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||||
|
|
||||||
|
const handleLike = () => {
|
||||||
|
if (!authed) { setShowLoginModal(true); return; }
|
||||||
|
|
||||||
|
// 1. UI 즉시 업데이트 (Optimistic)
|
||||||
|
setIsLiked(prev => !prev);
|
||||||
|
setLikeCount(prev => isLiked ? prev - 1 : prev + 1);
|
||||||
|
|
||||||
|
// 2. 기존 debounce 타이머 취소 후 재설정
|
||||||
|
if (likeDebounceRef.current) clearTimeout(likeDebounceRef.current);
|
||||||
|
likeDebounceRef.current = setTimeout(async () => {
|
||||||
|
const prevLiked = isLiked;
|
||||||
|
const prevCount = likeCount;
|
||||||
|
try {
|
||||||
|
await toggleVideoLike(videoId);
|
||||||
|
} catch (err) {
|
||||||
|
// 3. 실패 시 롤백
|
||||||
|
console.error('Failed to toggle like:', err);
|
||||||
|
setIsLiked(prevLiked);
|
||||||
|
setLikeCount(prevCount);
|
||||||
|
}
|
||||||
|
}, 500);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleHeaderAction = () => {
|
||||||
|
if (!isModal && !authed) { setShowLoginModal(true); return; }
|
||||||
|
onClose?.();
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCommentFocus = () => {
|
||||||
|
if (!authed) setShowLoginModal(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCommentSubmit = async () => {
|
||||||
|
if (!authed) { setShowLoginModal(true); return; }
|
||||||
|
if (!commentInput.trim() || commentSubmitting) return;
|
||||||
|
setCommentSubmitting(true);
|
||||||
|
try {
|
||||||
|
await postVideoComment(videoId, commentInput.trim(), commentNickname);
|
||||||
|
setCommentInput('');
|
||||||
|
if (commentTextareaRef.current) {
|
||||||
|
commentTextareaRef.current.style.height = 'auto';
|
||||||
|
}
|
||||||
|
setCommentNickname('');
|
||||||
|
setCommentAvatarSeedIdx(prev => (prev + 1) % AVATAR_SEEDS.length);
|
||||||
|
await fetchComments(1);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to post comment:', err);
|
||||||
|
} finally {
|
||||||
|
setCommentSubmitting(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleDeleteComment = async (commentId: number) => {
|
||||||
|
try {
|
||||||
|
await deleteComment(commentId);
|
||||||
|
await fetchComments(commentsPage);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to delete comment:', err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const renderCommentContent = (content: string | null, isDeleted: boolean) => {
|
||||||
|
if (isDeleted) return <span style={{ color: '#6B9EA0', fontStyle: 'italic' }}>(삭제된 댓글입니다.)</span>;
|
||||||
|
return content;
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={isModal ? 'video-detail-modal-content' : 'video-detail-page-content'}>
|
||||||
|
{/* 헤더 */}
|
||||||
|
<div className="video-detail-header">
|
||||||
|
{isModal ? (
|
||||||
|
<button className="video-detail-close-btn" onClick={handleHeaderAction} aria-label="닫기">
|
||||||
|
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||||
|
<line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
) : (
|
||||||
|
<button className="video-detail-back-btn" onClick={handleHeaderAction}>
|
||||||
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.5">
|
||||||
|
<path d="M13 4l-6 6 6 6"/>
|
||||||
|
</svg>
|
||||||
|
{t('sidebar.ado2Contents')}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{loading ? (
|
||||||
|
<div className="ado2-contents-loading">
|
||||||
|
<div className="loading-spinner"></div>
|
||||||
|
<p>{t('ado2Contents.loading')}</p>
|
||||||
|
</div>
|
||||||
|
) : error ? (
|
||||||
|
<div className="ado2-contents-error"><p>{error}</p></div>
|
||||||
|
) : video ? (
|
||||||
|
<div className={`video-detail-content ${isLandscape ? 'landscape' : ''}`}>
|
||||||
|
<video
|
||||||
|
src={video.result_movie_url}
|
||||||
|
controls
|
||||||
|
autoPlay
|
||||||
|
controlsList="nodownload"
|
||||||
|
onContextMenu={(e) => e.preventDefault()}
|
||||||
|
className="video-detail-player"
|
||||||
|
onLoadedMetadata={(e) => {
|
||||||
|
const v = e.currentTarget;
|
||||||
|
setIsLandscape(v.videoWidth > v.videoHeight);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div className="video-detail-info">
|
||||||
|
<h2 className="video-detail-store">{video.store_name}</h2>
|
||||||
|
<p className="video-detail-date">{formatDate(video.created_at)}</p>
|
||||||
|
|
||||||
|
{/* 좋아요 + 링크 복사 */}
|
||||||
|
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
|
||||||
|
<button
|
||||||
|
className={`video-detail-like-btn ${isLiked ? 'liked' : ''}`}
|
||||||
|
onClick={handleLike}
|
||||||
|
disabled={false}
|
||||||
|
>
|
||||||
|
<svg width="16" height="16" viewBox="0 0 24 24" fill={isLiked ? 'currentColor' : 'none'} stroke="currentColor" strokeWidth="2">
|
||||||
|
<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/>
|
||||||
|
</svg>
|
||||||
|
{likeCount}
|
||||||
|
</button>
|
||||||
|
<div style={{ position: 'relative' }} ref={shareMenuRef}>
|
||||||
|
<button
|
||||||
|
className="video-detail-copy-btn"
|
||||||
|
onClick={() => setShareMenuOpen(v => !v)}
|
||||||
|
>
|
||||||
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||||
|
<circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/>
|
||||||
|
<line x1="8.59" y1="13.51" x2="15.42" y2="17.49"/><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"/>
|
||||||
|
</svg>
|
||||||
|
{copied ? '복사됨!' : '공유하기'}
|
||||||
|
</button>
|
||||||
|
{shareMenuOpen && (
|
||||||
|
<div className="video-detail-share-menu">
|
||||||
|
{/* 카카오톡 */}
|
||||||
|
<button className="video-detail-share-item" onClick={handleKakaoShare}>
|
||||||
|
<svg width="18" height="18" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect width="20" height="20" rx="4" fill="#FEE500"/>
|
||||||
|
<path fillRule="evenodd" clipRule="evenodd" d="M10 3.5C6.134 3.5 3 6.01 3 9.1c0 1.98 1.2 3.72 3.01 4.76l-.74 2.75a.19.19 0 0 0 .28.21l3.37-2.23c.34.04.69.06 1.06.06 3.866 0 7-2.51 7-5.6S13.866 3.5 10 3.5z" fill="#3C1E1E"/>
|
||||||
|
</svg>
|
||||||
|
카카오톡
|
||||||
|
</button>
|
||||||
|
{/* 페이스북 */}
|
||||||
|
<button className="video-detail-share-item" onClick={handleFacebookShare}>
|
||||||
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="#1877F2">
|
||||||
|
<path d="M24 12.073C24 5.405 18.627 0 12 0S0 5.405 0 12.073C0 18.1 4.388 23.094 10.125 24v-8.437H7.078v-3.49h3.047V9.41c0-3.025 1.792-4.697 4.533-4.697 1.312 0 2.686.235 2.686.235v2.97h-1.513c-1.491 0-1.956.93-1.956 1.887v2.268h3.328l-.532 3.49h-2.796V24C19.612 23.094 24 18.1 24 12.073z"/>
|
||||||
|
</svg>
|
||||||
|
페이스북
|
||||||
|
</button>
|
||||||
|
{/* X (트위터) */}
|
||||||
|
<button className="video-detail-share-item" onClick={handleTwitterShare}>
|
||||||
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor">
|
||||||
|
<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>
|
||||||
|
</svg>
|
||||||
|
X (트위터)
|
||||||
|
</button>
|
||||||
|
{/* URL 복사 */}
|
||||||
|
<button className="video-detail-share-item" onClick={() => { handleCopyLink(); setShareMenuOpen(false); }}>
|
||||||
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||||
|
<rect x="9" y="9" width="13" height="13" rx="2"/>
|
||||||
|
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>
|
||||||
|
</svg>
|
||||||
|
{copied ? '복사됨!' : 'URL 복사'}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* 댓글 섹션 */}
|
||||||
|
<div className="video-detail-comments">
|
||||||
|
<div className="video-detail-comments-header">
|
||||||
|
<h3 className="video-detail-comments-title">댓글</h3>
|
||||||
|
<span className="video-detail-comments-count">{commentsTotal}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* 댓글 작성자 프로필 선택 */}
|
||||||
|
{authed && (
|
||||||
|
<div className="video-detail-comment-profile">
|
||||||
|
<img
|
||||||
|
src={`https://api.dicebear.com/9.x/pixel-art/svg?seed=${commentAvatarSeed}`}
|
||||||
|
alt="아바타 변경"
|
||||||
|
className="video-detail-comment-avatar"
|
||||||
|
onClick={handleChangeAvatar}
|
||||||
|
style={{ cursor: 'pointer' }}
|
||||||
|
title="클릭하여 아바타 변경"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
className="video-detail-nickname-input"
|
||||||
|
type="text"
|
||||||
|
placeholder="작성자 이름"
|
||||||
|
value={commentNickname}
|
||||||
|
onChange={(e) => setCommentNickname(e.target.value)}
|
||||||
|
maxLength={20}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div className="video-detail-comment-input-wrap">
|
||||||
|
<textarea
|
||||||
|
ref={commentTextareaRef}
|
||||||
|
className="video-detail-comment-input"
|
||||||
|
placeholder={authed ? '댓글을 입력하세요...' : '로그인 후 댓글을 작성할 수 있습니다'}
|
||||||
|
maxLength={500}
|
||||||
|
rows={1}
|
||||||
|
value={commentInput}
|
||||||
|
onChange={(e) => {
|
||||||
|
setCommentInput(e.target.value);
|
||||||
|
e.target.style.height = 'auto';
|
||||||
|
e.target.style.height = `${e.target.scrollHeight}px`;
|
||||||
|
}}
|
||||||
|
onFocus={handleCommentFocus}
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === 'Enter' && !e.shiftKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
handleCommentSubmit();
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
disabled={!authed}
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
className="video-detail-comment-submit"
|
||||||
|
onClick={handleCommentSubmit}
|
||||||
|
disabled={!authed || !commentInput.trim() || commentSubmitting}
|
||||||
|
>
|
||||||
|
{commentSubmitting ? '작성 중' : '작성'}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{comments.length === 0 && !commentsLoading ? (
|
||||||
|
<p className="video-detail-comments-empty">아직 댓글이 없습니다.</p>
|
||||||
|
) : (
|
||||||
|
<ul className="video-detail-comment-list">
|
||||||
|
{comments.map((c) => (
|
||||||
|
<li key={c.id} className="video-detail-comment-item">
|
||||||
|
<img
|
||||||
|
src={`https://api.dicebear.com/9.x/pixel-art/svg?seed=${c.id}`}
|
||||||
|
alt="avatar"
|
||||||
|
className="video-detail-comment-avatar"
|
||||||
|
/>
|
||||||
|
<div className="video-detail-comment-body">
|
||||||
|
<span className="video-detail-comment-nickname">
|
||||||
|
{c.nickname || '익명'}
|
||||||
|
</span>
|
||||||
|
<p className="video-detail-comment-text">
|
||||||
|
{renderCommentContent(c.content, c.is_deleted)}
|
||||||
|
</p>
|
||||||
|
<div className="video-detail-comment-bottom">
|
||||||
|
<span className="video-detail-comment-date">{formatCommentDate(c.created_at)}</span>
|
||||||
|
{c.is_mine && !c.is_deleted && (
|
||||||
|
<button
|
||||||
|
className="video-detail-comment-delete"
|
||||||
|
onClick={() => handleDeleteComment(c.id)}
|
||||||
|
>
|
||||||
|
삭제
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* 대댓글 (읽기 전용) */}
|
||||||
|
{c.replies && c.replies.length > 0 && (
|
||||||
|
<ul className="video-detail-reply-list">
|
||||||
|
{c.replies.map((r) => (
|
||||||
|
<li key={r.id} className="video-detail-reply-item">
|
||||||
|
<img
|
||||||
|
src={`https://api.dicebear.com/9.x/pixel-art/svg?seed=${r.id}`}
|
||||||
|
alt="avatar"
|
||||||
|
className="video-detail-comment-avatar small"
|
||||||
|
/>
|
||||||
|
<div className="video-detail-comment-body">
|
||||||
|
<span className="video-detail-comment-nickname">
|
||||||
|
{r.nickname || '익명'}
|
||||||
|
</span>
|
||||||
|
<p className="video-detail-comment-text">
|
||||||
|
{renderCommentContent(r.content, r.is_deleted)}
|
||||||
|
</p>
|
||||||
|
<div className="video-detail-comment-bottom">
|
||||||
|
<span className="video-detail-comment-date">{formatCommentDate(r.created_at)}</span>
|
||||||
|
{r.is_mine && !r.is_deleted && (
|
||||||
|
<button
|
||||||
|
className="video-detail-comment-delete"
|
||||||
|
onClick={() => handleDeleteComment(r.id)}
|
||||||
|
>
|
||||||
|
삭제
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{commentsHasNext && (
|
||||||
|
<button
|
||||||
|
className="video-detail-comments-more"
|
||||||
|
onClick={() => fetchComments(commentsPage + 1, true)}
|
||||||
|
disabled={commentsLoading}
|
||||||
|
>
|
||||||
|
{commentsLoading ? '불러오는 중...' : '댓글 더 보기'}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
|
||||||
|
{showLoginModal && (
|
||||||
|
<LoginPromptModal onClose={() => setShowLoginModal(false)} />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default VideoDetailContent;
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
import React, { useEffect } from 'react';
|
||||||
|
import VideoDetailContent from './VideoDetailContent';
|
||||||
|
|
||||||
|
interface VideoDetailModalProps {
|
||||||
|
videoId: string;
|
||||||
|
onClose: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const VideoDetailModal: React.FC<VideoDetailModalProps> = ({ videoId, onClose }) => {
|
||||||
|
useEffect(() => {
|
||||||
|
// 모달 열릴 때 배경 스크롤 잠금
|
||||||
|
const prev = document.body.style.overflow;
|
||||||
|
document.body.style.overflow = 'hidden';
|
||||||
|
|
||||||
|
const handleKeyDown = (e: KeyboardEvent) => {
|
||||||
|
if (e.key === 'Escape') onClose();
|
||||||
|
};
|
||||||
|
document.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
document.body.style.overflow = prev;
|
||||||
|
document.removeEventListener('keydown', handleKeyDown);
|
||||||
|
};
|
||||||
|
}, [onClose]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
position: 'fixed',
|
||||||
|
inset: 0,
|
||||||
|
background: 'rgba(0, 0, 0, 0.85)',
|
||||||
|
zIndex: 2000,
|
||||||
|
display: 'flex',
|
||||||
|
overflowY: 'auto',
|
||||||
|
padding: '24px 16px',
|
||||||
|
}}
|
||||||
|
onClick={onClose}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
background: '#01282A',
|
||||||
|
borderRadius: '16px',
|
||||||
|
width: '100%',
|
||||||
|
maxWidth: '900px',
|
||||||
|
margin: 'auto',
|
||||||
|
position: 'relative',
|
||||||
|
}}
|
||||||
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
>
|
||||||
|
<VideoDetailContent videoId={videoId} isModal={true} onClose={onClose} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default VideoDetailModal;
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import VideoDetailContent from './VideoDetailContent';
|
||||||
|
|
||||||
|
interface VideoDetailPageProps {
|
||||||
|
videoId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const VideoDetailPage: React.FC<VideoDetailPageProps> = ({ videoId }) => {
|
||||||
|
const handleBack = () => {
|
||||||
|
localStorage.setItem('castad_active_item', 'ADO2 콘텐츠');
|
||||||
|
window.location.href = '/';
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="video-detail-page">
|
||||||
|
<VideoDetailContent videoId={videoId} isModal={false} onClose={handleBack} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default VideoDetailPage;
|
||||||
@@ -4,6 +4,17 @@ import ReactDOM from 'react-dom/client';
|
|||||||
import './i18n';
|
import './i18n';
|
||||||
import App from './App';
|
import App from './App';
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
Kakao: any;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const kakaoKey = import.meta.env.VITE_KAKAO_JS_KEY as string | undefined;
|
||||||
|
if (kakaoKey && window.Kakao && !window.Kakao.isInitialized()) {
|
||||||
|
window.Kakao.init(kakaoKey);
|
||||||
|
}
|
||||||
|
|
||||||
const rootElement = document.getElementById('root');
|
const rootElement = document.getElementById('root');
|
||||||
if (!rootElement) {
|
if (!rootElement) {
|
||||||
throw new Error("Could not find root element to mount to");
|
throw new Error("Could not find root element to mount to");
|
||||||
|
|||||||
+244
-28
@@ -12,20 +12,101 @@
|
|||||||
"myContents": "My Contents",
|
"myContents": "My Contents",
|
||||||
"myInfo": "My Info",
|
"myInfo": "My Info",
|
||||||
"defaultUser": "User",
|
"defaultUser": "User",
|
||||||
|
"credits": "Credits left: {{count}}",
|
||||||
"loggingOut": "Logging out...",
|
"loggingOut": "Logging out...",
|
||||||
"logout": "Log Out"
|
"logout": "Log Out",
|
||||||
|
"tutorialRestart": "Restart Tutorial",
|
||||||
|
"tutorial": "Tutorial",
|
||||||
|
"tutorialOn": "Enable Tutorial",
|
||||||
|
"tutorialOff": "Disable Tutorial",
|
||||||
|
"inquiry": "Feedback"
|
||||||
|
},
|
||||||
|
"tutorial": {
|
||||||
|
"skip": "Skip",
|
||||||
|
"next": "Next",
|
||||||
|
"prev": "Back",
|
||||||
|
"finish": "Done",
|
||||||
|
"landing": {
|
||||||
|
"intro": { "title": "Welcome to ADO2 Tutorial", "desc": "We'll guide you through ADO2 step by step." },
|
||||||
|
"dropdown": { "title": "Choose Search Type", "desc": "Select URL or business name from the dropdown." },
|
||||||
|
"field": { "title": "Enter Search Term", "desc": "For URL, paste a Naver Maps share URL.\nFor business name, type the name and select from the list." },
|
||||||
|
"manual": { "title": "Direct Input", "desc": "You can also enter the business name and address manually to start analysis." },
|
||||||
|
"button": { "title": "Start Brand Analysis", "desc": "Click the button to let AI start analyzing your brand." }
|
||||||
|
},
|
||||||
|
"asset": {
|
||||||
|
"image": { "title": "Image List", "desc": "Photos from Naver Place. Tap 'Show more' to see the rest, or X to remove any." },
|
||||||
|
"upload": { "title": "Add Images", "desc": "You can freely add more images." },
|
||||||
|
"ratio": { "title": "Select Video Ratio", "desc": "Choose the ratio for the video to be generated." },
|
||||||
|
"next": { "title": "Next Step", "desc": "Proceed to the next step when ready." }
|
||||||
|
},
|
||||||
|
"sound": {
|
||||||
|
"genre": { "title": "Select Genre", "desc": "Pick a music genre that fits your brand.", "note": "Background music is coming soon." },
|
||||||
|
"language": { "title": "Select Language", "desc": "You can choose the language for the sound.\nWant to continue with Korean?" },
|
||||||
|
"generate": { "title": "Generate Sound", "desc": "Click the button and AI will generate lyrics and music in your chosen genre and language." },
|
||||||
|
"lyrics": { "title": "Lyrics Complete", "desc": "AI wrote lyrics in your selected language.\nCheck the generated lyrics." },
|
||||||
|
"lyricsWait": { "title": "Generating Music", "desc": "AI is composing music based on the lyrics.\nPlease wait a moment." },
|
||||||
|
"audioPlayer": { "title": "Preview the Music", "desc": "Music generation is complete.\nPress play to listen to the generated music." },
|
||||||
|
"video": { "title": "Generate Video", "desc": "Click the button to start generating your video." }
|
||||||
|
},
|
||||||
|
"myInfo": {
|
||||||
|
"myInfo": { "title": "My Info", "desc": "In My Info, you can manage your social connections and view connected accounts." },
|
||||||
|
"connect": { "title": "Connect Now", "desc": "Click the YouTube connect button to go to the connection page.", "note": "Instagram connection is coming soon." },
|
||||||
|
"connected": { "title": "Connected Accounts", "desc": "Your linked social accounts appear here.\nCheck after connecting." },
|
||||||
|
"ado2": { "title": "ADO2 Contents", "desc": "You can now upload the generated video.\nClick to navigate." }
|
||||||
|
},
|
||||||
|
"ado2": {
|
||||||
|
"list": { "title": "Generated Videos", "desc": "View all AI-created videos here." },
|
||||||
|
"download": { "title": "Download", "desc": "Download the video to your device." },
|
||||||
|
"delete": { "title": "Delete", "desc": "Remove videos you no longer need." },
|
||||||
|
"upload": { "title": "Upload to Social Media", "desc": "Select a video and upload it to social media." }
|
||||||
|
},
|
||||||
|
"completion": {
|
||||||
|
"contentInfo": { "title": "Content Info", "desc": "Check the title, genre, resolution, and lyrics of the generated content." },
|
||||||
|
"generating": { "title": "Generating Video", "desc": "AI is creating your video.\nPlease wait a moment." },
|
||||||
|
"completion": { "title": "Video Complete!", "desc": "Your video is ready. Want to take a look?" },
|
||||||
|
"myInfo": { "title": "Connect Social Account", "desc": "To upload your video to YouTube, connect your social account in My Info. Click to go there." }
|
||||||
|
},
|
||||||
|
"upload": {
|
||||||
|
"seo": { "title": "Title & Description", "desc": "AI is generating the title and description for your video. Please wait a moment." },
|
||||||
|
"required": { "title": "Required Fields", "desc": "Fields marked with * are required.\nPlease check them before uploading." },
|
||||||
|
"schedule": { "title": "Schedule Upload", "desc": "Post now or schedule for a specific time." },
|
||||||
|
"submit": { "title": "Start Upload", "desc": "Click the Post button to start uploading." }
|
||||||
|
},
|
||||||
|
"dashboard": {
|
||||||
|
"metrics": { "title": "Key Metrics", "desc": "Check views, subscribers, and other stats for content uploaded via ADO2." },
|
||||||
|
"chart": { "title": "Growth Chart", "desc": "Track your channel's growth over time." },
|
||||||
|
"more": { "title": "More Analytics", "desc": "Even more statistics are available at a glance on the dashboard." }
|
||||||
|
},
|
||||||
|
"contentCalendar": {
|
||||||
|
"grid": { "title": "Content Calendar", "desc": "View your content schedule by date.\nWhy not select today?" },
|
||||||
|
"panel": { "title": "Content List", "desc": "Check the detailed content schedule here." }
|
||||||
|
},
|
||||||
|
"feedback": {
|
||||||
|
"complete": { "title": "Tutorial Complete 🎉", "desc": "You've completed the full flow from brand analysis to YouTube upload.\nTo replay the tutorial, click the button in the top right." },
|
||||||
|
"title": "Customer Feedback",
|
||||||
|
"desc": "Share any issues or suggestions to help us improve."
|
||||||
|
},
|
||||||
|
"restart": {
|
||||||
|
"title": "Restart Tutorial?",
|
||||||
|
"desc": "The tutorial will restart from the current screen.",
|
||||||
|
"confirm": "Start",
|
||||||
|
"cancel": "Cancel"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"footer": {
|
"footer": {
|
||||||
|
"company":"O2O Inc.",
|
||||||
"businessNumber": "Business Registration No. : 620-87-00810 | CEO : Ahn Sungmin",
|
"businessNumber": "Business Registration No. : 620-87-00810 | CEO : Ahn Sungmin",
|
||||||
"headquarters": "HQ : 41593 Unicorn Lab Daegu A05, 5F, 111 Oksan-ro, Buk-gu, Daegu, Korea",
|
"headquarters": "HQ : Unicorn Lab Daegu A05, 5F, 111 Oksan-ro, Buk-gu, Daegu, Korea",
|
||||||
"researchCenter": "R&D : 13453 Rooms 504-505 (East), KT Pangyo Bldg, 32 Geumto-ro, Sujeong-gu, Seongnam-si, Gyeonggi-do, Korea",
|
"researchCenter": "R&D : Rooms 504-505 (East), KT Pangyo Bldg, 32 Geumto-ro, Sujeong-gu, Seongnam-si, Gyeonggi-do, Korea",
|
||||||
"phone": "Tel : 070-4260-8310 | 010-2755-6463",
|
"phone": "Tel : 070-4260-8310 | 010-2755-6463",
|
||||||
"email": "Email : o2oteam@o2o.kr"
|
"email": "Email : o2oteam@o2o.kr",
|
||||||
|
"privacyPolicy": "Privacy Policy",
|
||||||
|
"termsOfService": "Terms of Service"
|
||||||
},
|
},
|
||||||
"social": {
|
"social": {
|
||||||
"title": "Social Media Posting",
|
"title": "Social Media Posting",
|
||||||
"postNumber": "Post 1",
|
"postNumber": "Post 1",
|
||||||
"videoSpecs": "1080x1920 · 10 sec",
|
"videoSpecs": "720x1280 · 1:01",
|
||||||
"channelLabel": "Post Channel",
|
"channelLabel": "Post Channel",
|
||||||
"loadingAccounts": "Loading accounts...",
|
"loadingAccounts": "Loading accounts...",
|
||||||
"noAccounts": "No connected social accounts.",
|
"noAccounts": "No connected social accounts.",
|
||||||
@@ -54,9 +135,9 @@
|
|||||||
"invalidVideoInfo": "Video information is invalid. (missing video_id)",
|
"invalidVideoInfo": "Video information is invalid. (missing video_id)",
|
||||||
"uploadStartFailed": "Failed to start upload.",
|
"uploadStartFailed": "Failed to start upload.",
|
||||||
"uploadFailed": "Upload failed.",
|
"uploadFailed": "Upload failed.",
|
||||||
"autoSeoTitle": "This will be automatically generated. please wait.",
|
"autoSeoTitle": "Auto-generating... (30–60 sec)",
|
||||||
"autoSeoDescription": "This will be automatically generated. please wait.",
|
"autoSeoDescription": "Auto-generating... (30–60 sec)",
|
||||||
"autoSeoTags": "This will be automatically generated. please wait."
|
"autoSeoTags": "Auto-generating... (30–60 sec)"
|
||||||
},
|
},
|
||||||
"upload": {
|
"upload": {
|
||||||
"title": "YouTube Upload",
|
"title": "YouTube Upload",
|
||||||
@@ -72,13 +153,14 @@
|
|||||||
"viewOnYoutube": "View on YouTube",
|
"viewOnYoutube": "View on YouTube",
|
||||||
"confirm": "OK",
|
"confirm": "OK",
|
||||||
"close": "Close",
|
"close": "Close",
|
||||||
"doNotClose": "Upload is in progress. Do not close this window."
|
"doNotClose": "Upload is in progress. Do not close this window.",
|
||||||
|
"goToCalendar": "View in Calendar"
|
||||||
},
|
},
|
||||||
"landing": {
|
"landing": {
|
||||||
"hero": {
|
"hero": {
|
||||||
"searchTypeBusinessName": "Business Name",
|
"searchTypeBusinessName": "Business Name",
|
||||||
"placeholderBusinessName": "Enter a business name",
|
"placeholderBusinessName": "Enter a business name",
|
||||||
"guideUrl": "A video will be automatically generated from the information gathered from the URL.",
|
"guideUrl": "Search for a place on Naver Maps, tap Share,\nthen paste the URL here.",
|
||||||
"guideBusinessName": "Search by business name to retrieve information.",
|
"guideBusinessName": "Search by business name to retrieve information.",
|
||||||
"errorUrlRequired": "Please enter a URL.",
|
"errorUrlRequired": "Please enter a URL.",
|
||||||
"errorNameRequired": "Please enter a business name.",
|
"errorNameRequired": "Please enter a business name.",
|
||||||
@@ -88,7 +170,17 @@
|
|||||||
"testDataLoading": "Loading...",
|
"testDataLoading": "Loading...",
|
||||||
"testData": "Test Data",
|
"testData": "Test Data",
|
||||||
"testDataLoadFailed": "Failed to load test data.",
|
"testDataLoadFailed": "Failed to load test data.",
|
||||||
"searching": "Searching..."
|
"searching": "Searching...",
|
||||||
|
"searchTypeManual": "Manual Input",
|
||||||
|
"manualModalTitle": "Enter Business Info",
|
||||||
|
"manualLabelName": "Business Name",
|
||||||
|
"manualLabelAddress": "Address",
|
||||||
|
"manualLabelRegion": "Region",
|
||||||
|
"manualLabelDetail": "Detail Address",
|
||||||
|
"manualPlaceholderName": "Enter the business name",
|
||||||
|
"manualPlaceholderAddress": "Enter the address",
|
||||||
|
"manualPlaceholderRegion": "Select a region",
|
||||||
|
"manualPlaceholderDetail": "Enter detail address (e.g. Gangnam-gu Teheran-ro 123)"
|
||||||
},
|
},
|
||||||
"welcome": {
|
"welcome": {
|
||||||
"title": "Welcome to ADO2.AI",
|
"title": "Welcome to ADO2.AI",
|
||||||
@@ -96,7 +188,7 @@
|
|||||||
"feature1Title": "Business Core Information Analysis",
|
"feature1Title": "Business Core Information Analysis",
|
||||||
"feature1Desc": "Enter the URL of your homepage,\nNaver Map, blog, etc.",
|
"feature1Desc": "Enter the URL of your homepage,\nNaver Map, blog, etc.",
|
||||||
"feature2Title": "Automated Promotional Content Creation",
|
"feature2Title": "Automated Promotional Content Creation",
|
||||||
"feature2Desc": "Based on analyzed information,\nautomatically create music, subtitles, songs,\nand videos tailored to your business",
|
"feature2Desc": "Based on analyzed information,\nautomatically create music, subtitles,\nand videos tailored to your business",
|
||||||
"feature3Title": "Multi-Channel Auto Distribution",
|
"feature3Title": "Multi-Channel Auto Distribution",
|
||||||
"feature3Desc": "Completed videos can be downloaded\nor uploaded directly to social media"
|
"feature3Desc": "Completed videos can be downloaded\nor uploaded directly to social media"
|
||||||
},
|
},
|
||||||
@@ -114,12 +206,26 @@
|
|||||||
"urlInput": {
|
"urlInput": {
|
||||||
"searchTypeBusinessName": "Business Name",
|
"searchTypeBusinessName": "Business Name",
|
||||||
"placeholderBusinessName": "Enter a business name",
|
"placeholderBusinessName": "Enter a business name",
|
||||||
"guideUrl": "A video will be automatically generated from the information gathered from the URL.",
|
"guideUrl": "Search for a place on Naver Maps, tap Share, then paste the URL here.",
|
||||||
"guideBusinessName": "Search by business name to retrieve information.",
|
"guideBusinessName": "Search by business name to retrieve information.",
|
||||||
"searchButton": "Search",
|
"searchButton": "Search",
|
||||||
"searching": "Searching...",
|
"searching": "Searching...",
|
||||||
"testDataLoading": "Loading...",
|
"testDataLoading": "Loading...",
|
||||||
"testData": "Test Data"
|
"testData": "Test Data",
|
||||||
|
"searchTypeManual": "Manual Input",
|
||||||
|
"errorSelectFromList": "Please select a business from the list.",
|
||||||
|
"errorUrlRequired": "Please enter a URL.",
|
||||||
|
"errorNameRequired": "Please enter a business name.",
|
||||||
|
"errorInvalidUrl": "Invalid URL format. (e.g. https://example.com)",
|
||||||
|
"manualModalTitle": "Enter Business Info",
|
||||||
|
"manualLabelName": "Business Name",
|
||||||
|
"manualLabelAddress": "Address",
|
||||||
|
"manualLabelRegion": "Region",
|
||||||
|
"manualLabelDetail": "Detail Address",
|
||||||
|
"manualPlaceholderName": "Enter the business name",
|
||||||
|
"manualPlaceholderAddress": "Enter the address",
|
||||||
|
"manualPlaceholderRegion": "Select a region",
|
||||||
|
"manualPlaceholderDetail": "Enter detail address (e.g. Gangnam-gu Teheran-ro 123)"
|
||||||
},
|
},
|
||||||
"assetManagement": {
|
"assetManagement": {
|
||||||
"title": "Brand Assets",
|
"title": "Brand Assets",
|
||||||
@@ -127,7 +233,7 @@
|
|||||||
"imageAlt": "Image",
|
"imageAlt": "Image",
|
||||||
"uploadBadge": "Uploaded",
|
"uploadBadge": "Uploaded",
|
||||||
"imageUpload": "Image Upload",
|
"imageUpload": "Image Upload",
|
||||||
"dragAndDrop": "Drag and drop\nimages to upload",
|
"dragAndDrop": "Drag & drop or\nclick to upload",
|
||||||
"videoRatio": "Video Ratio",
|
"videoRatio": "Video Ratio",
|
||||||
"minImages": "Min. 5 images",
|
"minImages": "Min. 5 images",
|
||||||
"youtubeShorts": "YouTube Shorts",
|
"youtubeShorts": "YouTube Shorts",
|
||||||
@@ -135,7 +241,7 @@
|
|||||||
"back": "Go Back",
|
"back": "Go Back",
|
||||||
"loadMore": "Load more",
|
"loadMore": "Load more",
|
||||||
"uploadFailed": "Image upload failed.",
|
"uploadFailed": "Image upload failed.",
|
||||||
"uploading": "Uploading...",
|
"uploading": "Uploading... (30 sec – 2 min)",
|
||||||
"nextStep": "Next Step"
|
"nextStep": "Next Step"
|
||||||
},
|
},
|
||||||
"soundStudio": {
|
"soundStudio": {
|
||||||
@@ -153,14 +259,17 @@
|
|||||||
"lyricsColumn": "Lyrics",
|
"lyricsColumn": "Lyrics",
|
||||||
"lyricsHint": "Select the lyrics area to edit",
|
"lyricsHint": "Select the lyrics area to edit",
|
||||||
"lyricsPlaceholder": "Lyrics will be displayed when sound is generated.",
|
"lyricsPlaceholder": "Lyrics will be displayed when sound is generated.",
|
||||||
|
"lyricsPlaceholderBGM": "Background music is generated without lyrics.",
|
||||||
"generateButton": "Generate Sound",
|
"generateButton": "Generate Sound",
|
||||||
|
"regenerateButton": "Regenerate",
|
||||||
|
"regenerateHint": "Press the regenerate button to create new lyrics and music.",
|
||||||
"generating": "Generating...",
|
"generating": "Generating...",
|
||||||
"generateVideo": "Generate Video",
|
"generateVideo": "Generate Video",
|
||||||
"videoGenerating": "Generating Video",
|
"videoGenerating": "Generating Video",
|
||||||
"noBusinessInfo": "No business information. Please try again.",
|
"noBusinessInfo": "No business information. Please try again.",
|
||||||
"noImageUploadInfo": "No image upload information. Please go back to the previous step and try again.",
|
"noImageUploadInfo": "No image upload information. Please go back to the previous step and try again.",
|
||||||
"generatingLyrics": "Generating lyrics...",
|
"generatingLyrics": "Generating lyrics...\n(30–60 sec)",
|
||||||
"generatingSong": "Generating song...",
|
"generatingSong": "Generating music...\n(1–2 min)",
|
||||||
"songQueued": "Song generation queued...",
|
"songQueued": "Song generation queued...",
|
||||||
"retryMessage": "Regenerating due to timeout... ({{count}}/{{max}})",
|
"retryMessage": "Regenerating due to timeout... ({{count}}/{{max}})",
|
||||||
"lyricGenerationFailed": "Lyrics generation request failed.",
|
"lyricGenerationFailed": "Lyrics generation request failed.",
|
||||||
@@ -171,7 +280,10 @@
|
|||||||
"musicGenerationFailed": "Music generation failed.",
|
"musicGenerationFailed": "Music generation failed.",
|
||||||
"multipleRetryFailed": "Music generation failed after multiple attempts. Please try again.",
|
"multipleRetryFailed": "Music generation failed after multiple attempts. Please try again.",
|
||||||
"musicGenerationError": "An error occurred during music generation.",
|
"musicGenerationError": "An error occurred during music generation.",
|
||||||
"songRegenerationError": "An error occurred during music regeneration."
|
"songRegenerationError": "An error occurred during music regeneration.",
|
||||||
|
"creditsRemaining": "{{count}} left",
|
||||||
|
"creditsExhausted": "Not enough credits.",
|
||||||
|
"chargeCredits": "Purchase credits"
|
||||||
},
|
},
|
||||||
"completion": {
|
"completion": {
|
||||||
"back": "Go Back",
|
"back": "Go Back",
|
||||||
@@ -179,6 +291,8 @@
|
|||||||
"titleError": "Video Generation Failed",
|
"titleError": "Video Generation Failed",
|
||||||
"titleComplete": "Content Creation Complete",
|
"titleComplete": "Content Creation Complete",
|
||||||
"imageAndVideo": "Images & Video",
|
"imageAndVideo": "Images & Video",
|
||||||
|
"checkingSubtitle": "Checking subtitle generation status...",
|
||||||
|
"waitingSubtitle": "Generating subtitles...",
|
||||||
"requestingGeneration": "Requesting video generation...",
|
"requestingGeneration": "Requesting video generation...",
|
||||||
"generatingVideo": "Generating video...",
|
"generatingVideo": "Generating video...",
|
||||||
"processingAfterRefresh": "Processing video... (recovered after refresh)",
|
"processingAfterRefresh": "Processing video... (recovered after refresh)",
|
||||||
@@ -190,7 +304,7 @@
|
|||||||
"statusPlanned": "Scheduled",
|
"statusPlanned": "Scheduled",
|
||||||
"statusWaiting": "Waiting",
|
"statusWaiting": "Waiting",
|
||||||
"statusTranscribing": "Transcribing",
|
"statusTranscribing": "Transcribing",
|
||||||
"statusRendering": "Rendering",
|
"statusRendering": "Rendering (2–3 min)",
|
||||||
"statusSucceeded": "Completed",
|
"statusSucceeded": "Completed",
|
||||||
"statusDefault": "Processing...",
|
"statusDefault": "Processing...",
|
||||||
"aiOptimization": "AI Optimization",
|
"aiOptimization": "AI Optimization",
|
||||||
@@ -212,7 +326,18 @@
|
|||||||
"videoNotReady": "The video is not ready yet.",
|
"videoNotReady": "The video is not ready yet.",
|
||||||
"youtubeUploadMessage": "Uploading video to YouTube channel \"{{channelName}}\".\n\n(Upload feature coming soon)",
|
"youtubeUploadMessage": "Uploading video to YouTube channel \"{{channelName}}\".\n\n(Upload feature coming soon)",
|
||||||
"deployComingSoon": "The deployment feature for the selected social channel is coming soon.",
|
"deployComingSoon": "The deployment feature for the selected social channel is coming soon.",
|
||||||
"youtubeExpiredAlert": "YouTube authentication has expired. Redirecting to reconnect page."
|
"youtubeExpiredAlert": "YouTube authentication has expired. Redirecting to reconnect page.",
|
||||||
|
"contentComplete": "Content Creation Complete",
|
||||||
|
"contentCompleteDesc": "Your optimized content has been created through AI analysis and editing",
|
||||||
|
"contentInfo": "File Name",
|
||||||
|
"genre": "Genre",
|
||||||
|
"resolution": "Resolution",
|
||||||
|
"lyrics": "Lyrics",
|
||||||
|
"sampleLyrics": "Loading lyrics...",
|
||||||
|
"noLyricsBGM": "Background music is generated without lyrics.",
|
||||||
|
"downloading": "Downloading...",
|
||||||
|
"download": "Download",
|
||||||
|
"uploadToSocial": "Upload to Social"
|
||||||
},
|
},
|
||||||
"dashboard": {
|
"dashboard": {
|
||||||
"title": "Dashboard",
|
"title": "Dashboard",
|
||||||
@@ -285,13 +410,44 @@
|
|||||||
"stayIntroReel": "Stay Meomum Introduction Reel",
|
"stayIntroReel": "Stay Meomum Introduction Reel",
|
||||||
"newYearEvent": "New Year Special Event",
|
"newYearEvent": "New Year Special Event",
|
||||||
"nightTimelapse": "Pension Night View Timelapse"
|
"nightTimelapse": "Pension Night View Timelapse"
|
||||||
}
|
},
|
||||||
|
"metricTotalViews": "Views",
|
||||||
|
"metricWatchTime": "Watch Time",
|
||||||
|
"metricAvgViewDuration": "Avg. Watch Duration",
|
||||||
|
"metricNewSubscribers": "New Subscribers",
|
||||||
|
"metricUploadedVideos": "Uploaded Videos",
|
||||||
|
"unitHours": "h",
|
||||||
|
"unitMinutes": "m",
|
||||||
|
"noDataInPeriod": "No data available for this period.",
|
||||||
|
"dataLoading": "Loading data...",
|
||||||
|
"noUploadsTitle": "No uploaded videos yet.",
|
||||||
|
"noUploadsDesc": "Upload videos via ADO2 to see real stats.",
|
||||||
|
"reconnectButton": "Reconnect →",
|
||||||
|
"connectButton": "Connect →",
|
||||||
|
"retryButton": "Retry →",
|
||||||
|
"selectAccount": "Select an account",
|
||||||
|
"modeAnnual": "Annual",
|
||||||
|
"modeMonthly": "Monthly",
|
||||||
|
"chartThisYear": "This Year",
|
||||||
|
"chartLastYear": "Last Year",
|
||||||
|
"chartThisMonth": "This Month",
|
||||||
|
"chartLastMonth": "Last Month",
|
||||||
|
"monthOverMonth": "Month-over-Month Growth",
|
||||||
|
"noAudienceData": "Not enough data to show real audience insights.",
|
||||||
|
"mockContentNotice": "The content shown below is sample data, not your actual content.",
|
||||||
|
"dataDelayTitle": "Data is being prepared",
|
||||||
|
"dataDelayDesc": "According to YouTube's policy, analytics data may take up to 48 hours to be reflected after a video is uploaded. Please check back later.",
|
||||||
|
"sampleHide": "Hide Sample",
|
||||||
|
"sampleShow": "Show Sample",
|
||||||
|
"recentVideosDesc": "Showing stats for the latest 30 videos uploaded via ADO2.",
|
||||||
|
"channelStatsDesc": "Showing stats for the selected channel.",
|
||||||
|
"youtubeApiFailed": "Failed to call YouTube Analytics API."
|
||||||
},
|
},
|
||||||
"myInfo": {
|
"myInfo": {
|
||||||
"title": "My Info",
|
"title": "My Info",
|
||||||
"tabBasic": "Basic Info",
|
"tabBasic": "Basic Info",
|
||||||
"tabPayment": "Payment Info",
|
"tabPayment": "Payment Info",
|
||||||
"tabBusiness": "My Business & Social Channel Management",
|
"tabBusiness": "Social Channel Management",
|
||||||
"basicPlaceholder": "Basic information settings are coming soon.",
|
"basicPlaceholder": "Basic information settings are coming soon.",
|
||||||
"paymentPlaceholder": "Payment information settings are coming soon.",
|
"paymentPlaceholder": "Payment information settings are coming soon.",
|
||||||
"myBusiness": "My Business",
|
"myBusiness": "My Business",
|
||||||
@@ -306,7 +462,22 @@
|
|||||||
"connected": "Connected",
|
"connected": "Connected",
|
||||||
"disconnectAccount": "Disconnect",
|
"disconnectAccount": "Disconnect",
|
||||||
"loadingAccounts": "Loading account information...",
|
"loadingAccounts": "Loading account information...",
|
||||||
"youtubeExpiredAlert": "YouTube authentication has expired. Redirecting to reconnect page."
|
"youtubeExpiredAlert": "YouTube authentication has expired. Redirecting to reconnect page.",
|
||||||
|
"creditsTitle": "Credit Balance",
|
||||||
|
"creditsLoading": "Loading...",
|
||||||
|
"creditsLabel": "Available Credits",
|
||||||
|
"creditsUnit": "credits",
|
||||||
|
"creditsDesc": "You can request a top-up from the admin if you run low on credits.",
|
||||||
|
"creditsChargeBtn": "Top Up",
|
||||||
|
"chargePopupTitle": "Credit Top-up Request",
|
||||||
|
"chargeAmountLabel": "Credits to Request",
|
||||||
|
"chargeNoteLabel": "Additional Notes",
|
||||||
|
"chargeNotePlaceholder": "Enter any message for the admin",
|
||||||
|
"chargeCancel": "Cancel",
|
||||||
|
"chargeSubmit": "Submit",
|
||||||
|
"chargeSubmitting": "Submitting...",
|
||||||
|
"chargeSuccess": "Your top-up request has been submitted!",
|
||||||
|
"chargeConfirm": "OK"
|
||||||
},
|
},
|
||||||
"ado2Contents": {
|
"ado2Contents": {
|
||||||
"title": "ADO2 Contents",
|
"title": "ADO2 Contents",
|
||||||
@@ -325,7 +496,14 @@
|
|||||||
"delete": "Delete",
|
"delete": "Delete",
|
||||||
"previous": "Previous",
|
"previous": "Previous",
|
||||||
"next": "Next",
|
"next": "Next",
|
||||||
"uploadToSocial": "Upload to social media"
|
"uploadToSocial": "Upload to social media",
|
||||||
|
"sortLatest": "Latest",
|
||||||
|
"sortOldest": "Oldest",
|
||||||
|
"sortLikes": "Most Liked",
|
||||||
|
"sortComments": "Most Commented",
|
||||||
|
"regionPlaceholder": "Select Region",
|
||||||
|
"searchPlaceholder": "Search by name",
|
||||||
|
"searchBtn": "Search"
|
||||||
},
|
},
|
||||||
"businessSettings": {
|
"businessSettings": {
|
||||||
"title": "Business Settings",
|
"title": "Business Settings",
|
||||||
@@ -354,7 +532,11 @@
|
|||||||
"generateContent": "Generate Content",
|
"generateContent": "Generate Content",
|
||||||
"pageDescBefore": " reveals ",
|
"pageDescBefore": " reveals ",
|
||||||
"pageDescAfter": "'s core strategy.",
|
"pageDescAfter": "'s core strategy.",
|
||||||
"loadingTitle": "Analyzing Brand"
|
"loadingTitle": "Analyzing Brand",
|
||||||
|
"loadingStep1": "Collecting brand information...",
|
||||||
|
"loadingStep2": "Analyzing collected data...",
|
||||||
|
"loadingStep3": "Deriving key strategies...",
|
||||||
|
"loadingStep4": "Organizing results..."
|
||||||
},
|
},
|
||||||
"common": {
|
"common": {
|
||||||
"back": "Go Back",
|
"back": "Go Back",
|
||||||
@@ -366,14 +548,48 @@
|
|||||||
"required": "*",
|
"required": "*",
|
||||||
"unknown": "Unknown"
|
"unknown": "Unknown"
|
||||||
},
|
},
|
||||||
|
"contentCalendar": {
|
||||||
|
"title": "Content Calendar",
|
||||||
|
"tabs": {
|
||||||
|
"all": "All",
|
||||||
|
"completed": "Done",
|
||||||
|
"scheduled": "Planned",
|
||||||
|
"failed": "Failed"
|
||||||
|
},
|
||||||
|
"status": {
|
||||||
|
"completed": "Done",
|
||||||
|
"scheduled": "Planned",
|
||||||
|
"failed": "Failed"
|
||||||
|
},
|
||||||
|
"months": ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],
|
||||||
|
"days": ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],
|
||||||
|
"yearMonth": "{{month}} {{year}}",
|
||||||
|
"monthDay": "{{month}} {{day}}",
|
||||||
|
"loading": "Loading...",
|
||||||
|
"noResults": "No recent results",
|
||||||
|
"noResultsDesc": "Upload your content to social channels",
|
||||||
|
"ado2Contents": "ADO2 Contents",
|
||||||
|
"cancel": "Cancel",
|
||||||
|
"retry": "Retry",
|
||||||
|
"cancelConfirm": "Are you sure you want to cancel this reservation?",
|
||||||
|
"cancelFailed": "Failed to cancel.",
|
||||||
|
"retryFailed": "Failed to retry.",
|
||||||
|
"completedCount": "Done {{count}}",
|
||||||
|
"scheduledCount": "Sched {{count}}",
|
||||||
|
"failedCount": "Fail {{count}}"
|
||||||
|
},
|
||||||
|
"loginPrompt": {
|
||||||
|
"title": "Login Required",
|
||||||
|
"loginBtn": "Login with Kakao"
|
||||||
|
},
|
||||||
"app": {
|
"app": {
|
||||||
"loginProcessing": "Processing login...",
|
"loginProcessing": "Processing login...",
|
||||||
"loginFailed": "Login processing failed. Please try again.",
|
"loginFailed": "Login processing failed. Please try again.",
|
||||||
"kakaoLoginFailed": "Kakao login failed. Please try again.",
|
"kakaoLoginFailed": "Kakao login failed. Please try again.",
|
||||||
"loginUrlFailed": "Failed to get login URL. Please try again.",
|
"loginUrlFailed": "Failed to get login URL. Please try again.",
|
||||||
"invalidUrl": "Invalid URL. Please enter a Naver Map URL.",
|
"invalidUrl": "Invalid URL. Please enter a Naver Map URL.",
|
||||||
"analysisError": "An error occurred during analysis. Please try again.",
|
"analysisError": "No results found. Please check your input and try again.",
|
||||||
"autocompleteError": "Failed to retrieve business information.",
|
"autocompleteError": "No results found. Please check your input and try again.",
|
||||||
"autocompleteGeneralError": "An error occurred while retrieving business information. Please try again.",
|
"autocompleteGeneralError": "An error occurred while retrieving business information. Please try again.",
|
||||||
"pageComingSoon": "{{page}} page is coming soon."
|
"pageComingSoon": "{{page}} page is coming soon."
|
||||||
}
|
}
|
||||||
|
|||||||
+252
-36
@@ -12,20 +12,101 @@
|
|||||||
"myContents": "내 콘텐츠",
|
"myContents": "내 콘텐츠",
|
||||||
"myInfo": "내 정보",
|
"myInfo": "내 정보",
|
||||||
"defaultUser": "사용자",
|
"defaultUser": "사용자",
|
||||||
|
"credits": "보유 크레딧: {{count}}",
|
||||||
"loggingOut": "로그아웃 중...",
|
"loggingOut": "로그아웃 중...",
|
||||||
"logout": "로그아웃"
|
"logout": "로그아웃",
|
||||||
|
"tutorialRestart": "튜토리얼 다시 보기",
|
||||||
|
"tutorial": "튜토리얼",
|
||||||
|
"tutorialOn": "튜토리얼 켜기",
|
||||||
|
"tutorialOff": "튜토리얼 끄기",
|
||||||
|
"inquiry": "고객의견"
|
||||||
|
},
|
||||||
|
"tutorial": {
|
||||||
|
"skip": "건너뛰기",
|
||||||
|
"next": "다음",
|
||||||
|
"prev": "이전",
|
||||||
|
"finish": "완료",
|
||||||
|
"landing": {
|
||||||
|
"intro": { "title": "ADO2 튜토리얼 시작", "desc": "ADO2 사용 방법을 단계별로 안내해 드릴게요." },
|
||||||
|
"dropdown": { "title": "검색 방식 선택", "desc": "드롭다운에서 URL 또는 업체명 중 원하는 방식을 선택하세요." },
|
||||||
|
"field": { "title": "입력하기", "desc": "URL 방식이라면 네이버 지도 공유 URL,\n업체명 방식이라면 업체명을 입력하고 목록에서 선택하세요." },
|
||||||
|
"manual": { "title": "직접 입력", "desc": "업체명과 주소를 직접 입력해서 분석을 시작할 수도 있어요." },
|
||||||
|
"button": { "title": "브랜드 분석 시작", "desc": "버튼을 누르면 AI가 브랜드를 분석하기 시작해요." }
|
||||||
|
},
|
||||||
|
"asset": {
|
||||||
|
"image": { "title": "이미지 목록", "desc": "네이버 Place에서 가져 온 사진이에요. \n더보기를 누르면 나머지 사진도 볼 수 있고 X를 눌러 삭제 할 수 있어요." },
|
||||||
|
"upload": { "title": "이미지 추가", "desc": "이미지를 자유롭게 추가 할 수 있어요." },
|
||||||
|
"ratio": { "title": "영상 비율 선택", "desc": "생성 할 영상의 비율을 선택하세요." },
|
||||||
|
"next": { "title": "다음 단계로", "desc": "설정이 완료되면 다음 단계로 진행하세요." }
|
||||||
|
},
|
||||||
|
"sound": {
|
||||||
|
"genre": { "title": "장르 선택", "desc": "영상에 어울리는 음악 장르를 선택하세요.", "note": "배경음악은 이후 오픈 예정입니다." },
|
||||||
|
"language": { "title": "언어 선택", "desc": "음악의 언어를 선택할 수 있어요. \n이미 선택된 한국어로 진행해볼까요?" },
|
||||||
|
"generate": { "title": "사운드 생성", "desc": "버튼을 클릭하면 AI가 가사와 음악을 생성해요."},
|
||||||
|
"lyrics": { "title": "가사 생성 완료", "desc": "AI가 선택한 언어로 가사를 만들었어요.\n생성된 가사를 확인하세요." },
|
||||||
|
"lyricsWait": { "title": "음악 생성 중", "desc": "가사를 바탕으로 AI가 음악을 만들고 있어요.\n잠시만 기다려 주세요." },
|
||||||
|
"audioPlayer": { "title": "음악 미리 듣기", "desc": "음악 생성이 완료되었어요.\n재생 버튼을 눌러 생성된 음악을 들어보세요." },
|
||||||
|
"video": { "title": "영상 생성", "desc": "버튼을 클릭해서 영상 생성을 시작하세요." }
|
||||||
|
},
|
||||||
|
"completion": {
|
||||||
|
"contentInfo": { "title": "콘텐츠 정보", "desc": "콘텐츠의 파일명, 장르, 규격, 가사를 확인하세요." },
|
||||||
|
"generating": { "title": "영상 제작 중", "desc": "AI가 영상을 만들고 있어요. \n잠시만 기다려 주세요." },
|
||||||
|
"completion": { "title": "영상 완성!", "desc": "영상 제작이 완료되었어요. \n영상을 확인해 볼까요?" },
|
||||||
|
"myInfo": { "title": "소셜 계정 연동", "desc": "영상을 유튜브에 업로드하려면 내 정보에서 소셜 계정을 연동해야 해요. \n클릭해서 이동하세요." }
|
||||||
|
},
|
||||||
|
"myInfo": {
|
||||||
|
"myInfo": { "title": "내 정보", "desc": "내 정보에서는 소셜 연결과 연결된 계정을 확인 할 수 있어요." },
|
||||||
|
"connect": { "title": "연결하기", "desc": "YouTube 연결 버튼을 누르면 연결 페이지로 이동합니다.", "note": "Instagram 연결은 오픈 예정입니다." },
|
||||||
|
"connected": { "title": "연결 계정", "desc": "연결된 소셜 계정 목록이에요. \n연결 후 여기서 확인할 수 있어요." },
|
||||||
|
"ado2": { "title": "ADO2 콘텐츠", "desc": "이제 생성된 영상을 업로드할 수 있어요. \n클릭해서 이동하세요." }
|
||||||
|
},
|
||||||
|
"ado2": {
|
||||||
|
"list": { "title": "생성된 영상 목록", "desc": "ADO2에서 만든 영상들을 확인할 수 있어요." },
|
||||||
|
"download": { "title": "다운로드", "desc": "영상을 다운로드 할 수 있어요." },
|
||||||
|
"delete": { "title": "삭제", "desc": "필요없는 영상을 삭제할 수 있어요." },
|
||||||
|
"upload": { "title": "소셜 업로드", "desc": "선택해서 소셜미디어에 업로드하세요." }
|
||||||
|
},
|
||||||
|
"upload": {
|
||||||
|
"seo": { "title": "제목 및 설명", "desc": "영상의 제목과 설명을 AI가 만들고 있어요. 잠시만 기다려 주세요." },
|
||||||
|
"required": { "title": "필수 항목", "desc": "영상을 업로드 하기 전 *는 필수 항목으로 \n반드시 확인해 주세요." },
|
||||||
|
"schedule": { "title": "업로드 예약", "desc": "지금 게시하거나 원하는 시간에 예약할 수 있어요." },
|
||||||
|
"submit": { "title": "업로드 시작", "desc": "게시 버튼을 눌러 업로드를 시작하세요." }
|
||||||
|
},
|
||||||
|
"dashboard": {
|
||||||
|
"metrics": { "title": "핵심 지표", "desc": "조회수, 구독자 등 ADO2로 업로드한 콘텐츠의 주요 통계를 확인하세요." },
|
||||||
|
"chart": { "title": "성장 추이 차트", "desc": "기간별 성장 추이를 그래프로 확인할 수 있어요." },
|
||||||
|
"more": { "title": "더 많은 통계", "desc": "그 외에도 다양한 통계를 대시보드에서 한눈에 확인할 수 있어요." }
|
||||||
|
},
|
||||||
|
"contentCalendar": {
|
||||||
|
"grid": { "title": "콘텐츠 캘린더", "desc": "날짜별로 콘텐츠 스케줄을 확인할 수 있어요. \n오늘 날짜를 선택해 볼까요?" },
|
||||||
|
"panel": { "title": "콘텐츠 목록", "desc": "자세한 콘텐츠 스케줄을 확인 할수 있어요." }
|
||||||
|
},
|
||||||
|
"feedback": {
|
||||||
|
"complete": { "title": "튜토리얼 완료 🎉", "desc": "유튜브 업로드까지 모든 과정을 완료했어요. \n튜토리얼을 다시보고 싶다면 우측 상단의 버튼을 눌러주세요." },
|
||||||
|
"title": "고객의견",
|
||||||
|
"desc": "서비스 이용 중 불편한 점이나 개선 의견을 보내주세요."
|
||||||
|
},
|
||||||
|
"restart": {
|
||||||
|
"title": "튜토리얼을 다시 시작할까요?",
|
||||||
|
"desc": "현재 화면부터 튜토리얼이 다시 시작됩니다.",
|
||||||
|
"confirm": "시작하기",
|
||||||
|
"cancel": "취소"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"footer": {
|
"footer": {
|
||||||
|
"company":"㈜에이아이오투오",
|
||||||
"businessNumber": "사업자 등록번호 : 620-87-00810 | 대표 : 안성민",
|
"businessNumber": "사업자 등록번호 : 620-87-00810 | 대표 : 안성민",
|
||||||
"headquarters": "본사 : 41593 대구광역시 북구 옥산로 111, 5층 유니콘랩 대구 A05호",
|
"headquarters": "본사 : 대구광역시 북구 옥산로 111, 5층 유니콘랩 대구 A05호",
|
||||||
"researchCenter": "연구소 : 13453 경기 성남시 수정구 금토로 32 (금토동) (주)KT 판교빌딩 504호~505호 (East)",
|
"researchCenter": "연구소 : 경기 성남시 수정구 금토로 32 (금토동) (주)KT 판교빌딩 504호~505호 (East)",
|
||||||
"phone": "전화 : 070-4260-8310 | 010-2755-6463",
|
"phone": "전화 : 070-4260-8310 | 010-2755-6463",
|
||||||
"email": "이메일 : o2oteam@o2o.kr"
|
"email": "이메일 : o2oteam@o2o.kr",
|
||||||
|
"privacyPolicy": "개인정보처리방침",
|
||||||
|
"termsOfService": "서비스 약관"
|
||||||
},
|
},
|
||||||
"social": {
|
"social": {
|
||||||
"title": "소셜 미디어 포스팅",
|
"title": "소셜 미디어 포스팅",
|
||||||
"postNumber": "게시물 1",
|
"postNumber": "게시물 1",
|
||||||
"videoSpecs": "1080x1920 · 10초",
|
"videoSpecs": "720x1280 · 1:01",
|
||||||
"channelLabel": "게시 채널",
|
"channelLabel": "게시 채널",
|
||||||
"loadingAccounts": "계정 로딩 중...",
|
"loadingAccounts": "계정 로딩 중...",
|
||||||
"noAccounts": "연결된 소셜 계정이 없습니다.",
|
"noAccounts": "연결된 소셜 계정이 없습니다.",
|
||||||
@@ -54,9 +135,9 @@
|
|||||||
"invalidVideoInfo": "영상 정보가 올바르지 않습니다. (video_id 누락)",
|
"invalidVideoInfo": "영상 정보가 올바르지 않습니다. (video_id 누락)",
|
||||||
"uploadStartFailed": "업로드 시작에 실패했습니다.",
|
"uploadStartFailed": "업로드 시작에 실패했습니다.",
|
||||||
"uploadFailed": "업로드에 실패했습니다.",
|
"uploadFailed": "업로드에 실패했습니다.",
|
||||||
"autoSeoTitle": "자동으로 작성중입니다. 기다려주세요.",
|
"autoSeoTitle": "자동으로 작성중입니다. (30~60초 소요)",
|
||||||
"autoSeoDescription": "자동으로 작성중입니다. 기다려주세요.",
|
"autoSeoDescription": "자동으로 작성중입니다. (30~60초 소요)",
|
||||||
"autoSeoTags": "자동으로 작성중입니다. 기다려주세요."
|
"autoSeoTags": "자동으로 작성중입니다. (30~60초 소요)"
|
||||||
},
|
},
|
||||||
"upload": {
|
"upload": {
|
||||||
"title": "YouTube 업로드",
|
"title": "YouTube 업로드",
|
||||||
@@ -72,13 +153,14 @@
|
|||||||
"viewOnYoutube": "YouTube에서 보기",
|
"viewOnYoutube": "YouTube에서 보기",
|
||||||
"confirm": "확인",
|
"confirm": "확인",
|
||||||
"close": "닫기",
|
"close": "닫기",
|
||||||
"doNotClose": "업로드가 진행 중입니다. 창을 닫지 마세요."
|
"doNotClose": "업로드가 진행 중입니다. 창을 닫지 마세요.",
|
||||||
|
"goToCalendar": "캘린더에서 확인"
|
||||||
},
|
},
|
||||||
"landing": {
|
"landing": {
|
||||||
"hero": {
|
"hero": {
|
||||||
"searchTypeBusinessName": "업체명",
|
"searchTypeBusinessName": "업체명",
|
||||||
"placeholderBusinessName": "업체명을 입력하세요",
|
"placeholderBusinessName": "업체명을 입력하세요.",
|
||||||
"guideUrl": "URL에서 가져온 정보로 영상이 자동 생성됩니다.",
|
"guideUrl": "네이버지도에서 장소를 검색하고 공유 선택, \n나오는 URL을 붙여 넣어 주세요.",
|
||||||
"guideBusinessName": "업체명으로 검색하여 정보를 가져옵니다.",
|
"guideBusinessName": "업체명으로 검색하여 정보를 가져옵니다.",
|
||||||
"errorUrlRequired": "URL을 입력해주세요.",
|
"errorUrlRequired": "URL을 입력해주세요.",
|
||||||
"errorNameRequired": "업체명을 입력해주세요.",
|
"errorNameRequired": "업체명을 입력해주세요.",
|
||||||
@@ -88,15 +170,25 @@
|
|||||||
"testDataLoading": "로딩 중...",
|
"testDataLoading": "로딩 중...",
|
||||||
"testData": "테스트 데이터",
|
"testData": "테스트 데이터",
|
||||||
"testDataLoadFailed": "테스트 데이터를 불러오는데 실패했습니다.",
|
"testDataLoadFailed": "테스트 데이터를 불러오는데 실패했습니다.",
|
||||||
"searching": "검색 중..."
|
"searching": "검색 중...",
|
||||||
|
"searchTypeManual": "직접 입력",
|
||||||
|
"manualModalTitle": "업체 정보 입력",
|
||||||
|
"manualLabelName": "업체명",
|
||||||
|
"manualLabelAddress": "주소",
|
||||||
|
"manualLabelRegion": "지역",
|
||||||
|
"manualLabelDetail": "상세 주소",
|
||||||
|
"manualPlaceholderName": "업체명을 입력하세요.",
|
||||||
|
"manualPlaceholderAddress": "주소를 입력하세요.",
|
||||||
|
"manualPlaceholderRegion": "지역을 선택하세요.",
|
||||||
|
"manualPlaceholderDetail": "상세 주소를 입력하세요. (예: 강남구 테헤란로 123)"
|
||||||
},
|
},
|
||||||
"welcome": {
|
"welcome": {
|
||||||
"title": "ADO2.AI에 오신 것을 환영합니다.",
|
"title": "ADO2.AI에 오신 것을 환영합니다.",
|
||||||
"subtitle": "분석, 제작, 배포까지 콘텐츠 마케팅의 전과정을 자동화",
|
"subtitle": "분석, 제작, 배포까지 콘텐츠 마케팅의 전과정을 자동화",
|
||||||
"feature1Title": "비즈니스 핵심 정보 분석",
|
"feature1Title": "비즈니스 핵심 정보 분석",
|
||||||
"feature1Desc": "홈페이지, 네이버 지도, 블로그 등의\nURL을 입력하세요",
|
"feature1Desc": "홈페이지, 네이버 지도, 블로그 등의\nURL을 입력하세요.",
|
||||||
"feature2Title": "홍보 콘텐츠 자동 제작",
|
"feature2Title": "홍보 콘텐츠 자동 제작",
|
||||||
"feature2Desc": "분석된 정보를 바탕으로\n비즈니스에 맞는 음악, 자막, 노래, 영상을\n자동으로 제작해요",
|
"feature2Desc": "분석된 정보를 바탕으로\n비즈니스에 맞는 음악, 자막, 영상을\n자동으로 제작해요",
|
||||||
"feature3Title": "멀티채널 자동 배포",
|
"feature3Title": "멀티채널 자동 배포",
|
||||||
"feature3Desc": "완성된 영상은 다운로드하거나\n바로 SNS에 업로드 할 수 있어요"
|
"feature3Desc": "완성된 영상은 다운로드하거나\n바로 SNS에 업로드 할 수 있어요"
|
||||||
},
|
},
|
||||||
@@ -113,13 +205,27 @@
|
|||||||
},
|
},
|
||||||
"urlInput": {
|
"urlInput": {
|
||||||
"searchTypeBusinessName": "업체명",
|
"searchTypeBusinessName": "업체명",
|
||||||
"placeholderBusinessName": "업체명을 입력하세요",
|
"placeholderBusinessName": "업체명을 입력하세요.",
|
||||||
"guideUrl": "URL에서 가져온 정보로 영상이 자동 생성됩니다.",
|
"guideUrl": "네이버지도에서 장소를 검색하고 공유 선택, \n나오는 URL을 붙여 넣어 주세요.",
|
||||||
"guideBusinessName": "업체명으로 검색하여 정보를 가져옵니다.",
|
"guideBusinessName": "업체명으로 검색하여 정보를 가져옵니다.",
|
||||||
"searchButton": "검색하기",
|
"searchButton": "검색하기",
|
||||||
"searching": "검색 중...",
|
"searching": "검색 중...",
|
||||||
"testDataLoading": "로딩 중...",
|
"testDataLoading": "로딩 중...",
|
||||||
"testData": "테스트 데이터"
|
"testData": "테스트 데이터",
|
||||||
|
"searchTypeManual": "직접 입력",
|
||||||
|
"errorSelectFromList": "목록에서 업체를 선택해 주세요.",
|
||||||
|
"errorUrlRequired": "URL을 입력해주세요.",
|
||||||
|
"errorNameRequired": "업체명을 입력해주세요.",
|
||||||
|
"errorInvalidUrl": "올바른 URL 형식이 아닙니다. (예: https://example.com)",
|
||||||
|
"manualModalTitle": "업체 정보 입력",
|
||||||
|
"manualLabelName": "업체명",
|
||||||
|
"manualLabelAddress": "주소",
|
||||||
|
"manualLabelRegion": "지역",
|
||||||
|
"manualLabelDetail": "상세 주소",
|
||||||
|
"manualPlaceholderName": "업체명을 입력하세요.",
|
||||||
|
"manualPlaceholderAddress": "주소를 입력하세요.",
|
||||||
|
"manualPlaceholderRegion": "지역을 선택하세요.",
|
||||||
|
"manualPlaceholderDetail": "상세 주소를 입력하세요. (예: 강남구 테헤란로 123)"
|
||||||
},
|
},
|
||||||
"assetManagement": {
|
"assetManagement": {
|
||||||
"title": "브랜드 에셋",
|
"title": "브랜드 에셋",
|
||||||
@@ -127,7 +233,7 @@
|
|||||||
"imageAlt": "이미지",
|
"imageAlt": "이미지",
|
||||||
"uploadBadge": "업로드",
|
"uploadBadge": "업로드",
|
||||||
"imageUpload": "이미지 업로드",
|
"imageUpload": "이미지 업로드",
|
||||||
"dragAndDrop": "이미지를 드래그하여\n업로드",
|
"dragAndDrop": "이미지를 끌어다 놓거나\n클릭하여 업로드",
|
||||||
"videoRatio": "영상 비율",
|
"videoRatio": "영상 비율",
|
||||||
"minImages": "최소 5장",
|
"minImages": "최소 5장",
|
||||||
"youtubeShorts": "유튜브 쇼츠",
|
"youtubeShorts": "유튜브 쇼츠",
|
||||||
@@ -135,7 +241,7 @@
|
|||||||
"back": "뒤로가기",
|
"back": "뒤로가기",
|
||||||
"loadMore": "더보기",
|
"loadMore": "더보기",
|
||||||
"uploadFailed": "이미지 업로드에 실패했습니다.",
|
"uploadFailed": "이미지 업로드에 실패했습니다.",
|
||||||
"uploading": "업로드 중...",
|
"uploading": "업로드 중 (30초~2분 소요)",
|
||||||
"nextStep": "다음 단계"
|
"nextStep": "다음 단계"
|
||||||
},
|
},
|
||||||
"soundStudio": {
|
"soundStudio": {
|
||||||
@@ -148,20 +254,23 @@
|
|||||||
"genreLabel": "장르 선택",
|
"genreLabel": "장르 선택",
|
||||||
"genreAuto": "자동 선택",
|
"genreAuto": "자동 선택",
|
||||||
"genreBallad": "발라드",
|
"genreBallad": "발라드",
|
||||||
"languageLabel": "언어",
|
"languageLabel": "언어 선택",
|
||||||
"languageKorean": "한국어",
|
"languageKorean": "한국어",
|
||||||
"lyricsColumn": "가사",
|
"lyricsColumn": "가사",
|
||||||
"lyricsHint": "가사 영역을 선택해서 수정 가능해요",
|
"lyricsHint": "가사 영역을 선택해서 수정 가능해요",
|
||||||
"lyricsPlaceholder": "사운드 생성 시 가사 표시됩니다.",
|
"lyricsPlaceholder": "사운드 생성 시 가사 표시됩니다.",
|
||||||
|
"lyricsPlaceholderBGM": "배경음악은 가사 없이 생성됩니다.",
|
||||||
"generateButton": "사운드 생성",
|
"generateButton": "사운드 생성",
|
||||||
|
"regenerateButton": "재생성 하기",
|
||||||
|
"regenerateHint": "재생성 버튼을 누르면 가사와 음악을 다시 만들 수 있어요.",
|
||||||
"generating": "생성 중...",
|
"generating": "생성 중...",
|
||||||
"generateVideo": "영상 생성하기",
|
"generateVideo": "영상 생성하기",
|
||||||
"videoGenerating": "영상 생성 중",
|
"videoGenerating": "영상 생성 중",
|
||||||
"noBusinessInfo": "비즈니스 정보가 없습니다. 다시 시도해주세요.",
|
"noBusinessInfo": "비즈니스 정보가 없습니다. 다시 시도해주세요.",
|
||||||
"noImageUploadInfo": "이미지 업로드 정보가 없습니다. 이전 단계로 돌아가 다시 시도해주세요.",
|
"noImageUploadInfo": "이미지 업로드 정보가 없습니다. 이전 단계로 돌아가 다시 시도해주세요.",
|
||||||
"generatingLyrics": "가사를 생성하고 있습니다...",
|
"generatingLyrics": "가사를 생성하고 있습니다. (30~60초 소요)",
|
||||||
"generatingSong": "노래를 생성하고 있습니다...",
|
"generatingSong": "음악을 생성하고 있습니다. (1~2분 소요)",
|
||||||
"songQueued": "노래 생성 대기 중...",
|
"songQueued": "음악 생성 대기 중...",
|
||||||
"retryMessage": "시간 초과로 재생성 중... ({{count}}/{{max}})",
|
"retryMessage": "시간 초과로 재생성 중... ({{count}}/{{max}})",
|
||||||
"lyricGenerationFailed": "가사 생성 요청에 실패했습니다.",
|
"lyricGenerationFailed": "가사 생성 요청에 실패했습니다.",
|
||||||
"lyricNotReceived": "가사를 받지 못했습니다.",
|
"lyricNotReceived": "가사를 받지 못했습니다.",
|
||||||
@@ -171,7 +280,10 @@
|
|||||||
"musicGenerationFailed": "음악 생성에 실패했습니다.",
|
"musicGenerationFailed": "음악 생성에 실패했습니다.",
|
||||||
"multipleRetryFailed": "여러 번 시도했지만 음악 생성에 실패했습니다. 다시 시도해주세요.",
|
"multipleRetryFailed": "여러 번 시도했지만 음악 생성에 실패했습니다. 다시 시도해주세요.",
|
||||||
"musicGenerationError": "음악 생성 중 오류가 발생했습니다.",
|
"musicGenerationError": "음악 생성 중 오류가 발생했습니다.",
|
||||||
"songRegenerationError": "음악 재생성 중 오류가 발생했습니다."
|
"songRegenerationError": "음악 재생성 중 오류가 발생했습니다.",
|
||||||
|
"creditsRemaining": "잔여 {{count}}",
|
||||||
|
"creditsExhausted": "크레딧이 부족합니다.",
|
||||||
|
"chargeCredits": "크레딧 충전하기"
|
||||||
},
|
},
|
||||||
"completion": {
|
"completion": {
|
||||||
"back": "뒤로가기",
|
"back": "뒤로가기",
|
||||||
@@ -179,6 +291,8 @@
|
|||||||
"titleError": "영상 생성 실패",
|
"titleError": "영상 생성 실패",
|
||||||
"titleComplete": "콘텐츠 제작 완료",
|
"titleComplete": "콘텐츠 제작 완료",
|
||||||
"imageAndVideo": "이미지 및 영상",
|
"imageAndVideo": "이미지 및 영상",
|
||||||
|
"checkingSubtitle": "자막 생성 상태를 확인하고 있습니다...",
|
||||||
|
"waitingSubtitle": "자막을 생성하고 있습니다...",
|
||||||
"requestingGeneration": "영상 생성을 요청하고 있습니다...",
|
"requestingGeneration": "영상 생성을 요청하고 있습니다...",
|
||||||
"generatingVideo": "영상을 생성하고 있습니다...",
|
"generatingVideo": "영상을 생성하고 있습니다...",
|
||||||
"processingAfterRefresh": "영상을 처리하고 있습니다... (새로고침 후 복구됨)",
|
"processingAfterRefresh": "영상을 처리하고 있습니다... (새로고침 후 복구됨)",
|
||||||
@@ -190,7 +304,7 @@
|
|||||||
"statusPlanned": "예약됨",
|
"statusPlanned": "예약됨",
|
||||||
"statusWaiting": "대기 중",
|
"statusWaiting": "대기 중",
|
||||||
"statusTranscribing": "트랜스크립션 중",
|
"statusTranscribing": "트랜스크립션 중",
|
||||||
"statusRendering": "렌더링 중",
|
"statusRendering": "생성 중 (2~3분 소요)",
|
||||||
"statusSucceeded": "완료",
|
"statusSucceeded": "완료",
|
||||||
"statusDefault": "처리 중...",
|
"statusDefault": "처리 중...",
|
||||||
"aiOptimization": "AI 최적화",
|
"aiOptimization": "AI 최적화",
|
||||||
@@ -212,7 +326,18 @@
|
|||||||
"videoNotReady": "영상이 아직 준비되지 않았습니다.",
|
"videoNotReady": "영상이 아직 준비되지 않았습니다.",
|
||||||
"youtubeUploadMessage": "YouTube 채널 \"{{channelName}}\"에 영상을 업로드합니다.\n\n(업로드 기능 준비 중)",
|
"youtubeUploadMessage": "YouTube 채널 \"{{channelName}}\"에 영상을 업로드합니다.\n\n(업로드 기능 준비 중)",
|
||||||
"deployComingSoon": "선택한 소셜 채널에 배포 기능이 준비 중입니다.",
|
"deployComingSoon": "선택한 소셜 채널에 배포 기능이 준비 중입니다.",
|
||||||
"youtubeExpiredAlert": "YouTube 인증이 만료되었습니다. 재연동 페이지로 이동합니다."
|
"youtubeExpiredAlert": "YouTube 인증이 만료되었습니다. 재연동 페이지로 이동합니다.",
|
||||||
|
"contentComplete": "콘텐츠 제작 완료",
|
||||||
|
"contentCompleteDesc": "AI 분석 및 편집을 통해 최적화된 콘텐츠가 완성되었습니다",
|
||||||
|
"contentInfo": "파일명",
|
||||||
|
"genre": "장르",
|
||||||
|
"resolution": "규격",
|
||||||
|
"lyrics": "가사",
|
||||||
|
"sampleLyrics": "가사를 불러오는 중...",
|
||||||
|
"noLyricsBGM": "배경음악은 가사 없이 생성됩니다.",
|
||||||
|
"downloading": "다운로드 중...",
|
||||||
|
"download": "다운로드",
|
||||||
|
"uploadToSocial": "소셜 채널 업로드"
|
||||||
},
|
},
|
||||||
"dashboard": {
|
"dashboard": {
|
||||||
"title": "대시보드",
|
"title": "대시보드",
|
||||||
@@ -285,13 +410,44 @@
|
|||||||
"stayIntroReel": "스테이 머뭄 소개 릴스",
|
"stayIntroReel": "스테이 머뭄 소개 릴스",
|
||||||
"newYearEvent": "신년 특가 이벤트 안내",
|
"newYearEvent": "신년 특가 이벤트 안내",
|
||||||
"nightTimelapse": "펜션 야경 타임랩스"
|
"nightTimelapse": "펜션 야경 타임랩스"
|
||||||
}
|
},
|
||||||
|
"metricTotalViews": "조회수",
|
||||||
|
"metricWatchTime": "시청시간",
|
||||||
|
"metricAvgViewDuration": "평균 시청시간",
|
||||||
|
"metricNewSubscribers": "신규 구독자",
|
||||||
|
"metricUploadedVideos": "업로드 영상",
|
||||||
|
"unitHours": "시간",
|
||||||
|
"unitMinutes": "분",
|
||||||
|
"noDataInPeriod": "이 기간에 데이터가 없습니다.",
|
||||||
|
"dataLoading": "데이터 로딩 중...",
|
||||||
|
"noUploadsTitle": "아직 업로드된 영상이 없습니다.",
|
||||||
|
"noUploadsDesc": "ADO2에서 영상을 업로드하면 실제 통계가 표시됩니다.",
|
||||||
|
"reconnectButton": "재연동하러 가기 →",
|
||||||
|
"connectButton": "연동하러 가기 →",
|
||||||
|
"retryButton": "재시도 →",
|
||||||
|
"selectAccount": "계정을 선택하세요",
|
||||||
|
"modeAnnual": "연간",
|
||||||
|
"modeMonthly": "월간",
|
||||||
|
"chartThisYear": "올해",
|
||||||
|
"chartLastYear": "작년",
|
||||||
|
"chartThisMonth": "이번달",
|
||||||
|
"chartLastMonth": "지난달",
|
||||||
|
"monthOverMonth": "전월 대비 성장",
|
||||||
|
"noAudienceData": "누적 데이터가 부족하여 실제 시청자 정보가 없습니다.",
|
||||||
|
"mockContentNotice": "현재 표시된 콘텐츠는 실제 데이터가 아닌 샘플 데이터입니다.",
|
||||||
|
"dataDelayTitle": "데이터 준비 중",
|
||||||
|
"dataDelayDesc": "유튜브 정책에 따라 분석 데이터는 영상 업로드 후 최대 48시간이 지나야 반영됩니다. 나중에 다시 확인해 주세요.",
|
||||||
|
"sampleHide": "Sample 숨기기",
|
||||||
|
"sampleShow": "Sample 보기",
|
||||||
|
"recentVideosDesc": "ADO2에서 업로드한 최근 30개의 영상 통계가 표시됩니다.",
|
||||||
|
"channelStatsDesc": "선택한 채널의 통계가 표시됩니다.",
|
||||||
|
"youtubeApiFailed": "YouTube Analytics API 호출에 실패했습니다."
|
||||||
},
|
},
|
||||||
"myInfo": {
|
"myInfo": {
|
||||||
"title": "내 정보",
|
"title": "내 정보",
|
||||||
"tabBasic": "기본 정보",
|
"tabBasic": "기본 정보",
|
||||||
"tabPayment": "결제 정보",
|
"tabPayment": "결제 정보",
|
||||||
"tabBusiness": "내 비즈니스 & 소셜 채널 관리",
|
"tabBusiness": "소셜 채널 관리",
|
||||||
"basicPlaceholder": "기본 정보 설정 기능이 준비 중입니다.",
|
"basicPlaceholder": "기본 정보 설정 기능이 준비 중입니다.",
|
||||||
"paymentPlaceholder": "결제 정보 설정 기능이 준비 중입니다.",
|
"paymentPlaceholder": "결제 정보 설정 기능이 준비 중입니다.",
|
||||||
"myBusiness": "내 비즈니스",
|
"myBusiness": "내 비즈니스",
|
||||||
@@ -306,7 +462,22 @@
|
|||||||
"connected": "연결됨",
|
"connected": "연결됨",
|
||||||
"disconnectAccount": "연결 해제",
|
"disconnectAccount": "연결 해제",
|
||||||
"loadingAccounts": "계정 정보를 불러오는 중...",
|
"loadingAccounts": "계정 정보를 불러오는 중...",
|
||||||
"youtubeExpiredAlert": "YouTube 인증이 만료되었습니다. 재연동 페이지로 이동합니다."
|
"youtubeExpiredAlert": "YouTube 인증이 만료되었습니다. 재연동 페이지로 이동합니다.",
|
||||||
|
"creditsTitle": "크레딧 현황",
|
||||||
|
"creditsLoading": "로딩 중...",
|
||||||
|
"creditsLabel": "보유 크레딧",
|
||||||
|
"creditsUnit": "크레딧",
|
||||||
|
"creditsDesc": "크레딧이 부족하면 관리자에게 충전 요청할 수 있습니다.",
|
||||||
|
"creditsChargeBtn": "충전하기",
|
||||||
|
"chargePopupTitle": "크레딧 충전 요청",
|
||||||
|
"chargeAmountLabel": "충전 크레딧",
|
||||||
|
"chargeNoteLabel": "기타 내용",
|
||||||
|
"chargeNotePlaceholder": "관리자에게 전달할 내용을 입력해주세요",
|
||||||
|
"chargeCancel": "취소",
|
||||||
|
"chargeSubmit": "요청하기",
|
||||||
|
"chargeSubmitting": "요청 중...",
|
||||||
|
"chargeSuccess": "충전 요청이 완료 되었습니다!",
|
||||||
|
"chargeConfirm": "확인"
|
||||||
},
|
},
|
||||||
"ado2Contents": {
|
"ado2Contents": {
|
||||||
"title": "ADO2 콘텐츠",
|
"title": "ADO2 콘텐츠",
|
||||||
@@ -325,7 +496,14 @@
|
|||||||
"delete": "삭제",
|
"delete": "삭제",
|
||||||
"previous": "이전",
|
"previous": "이전",
|
||||||
"next": "다음",
|
"next": "다음",
|
||||||
"uploadToSocial": "소셜 미디어에 업로드"
|
"uploadToSocial": "소셜 미디어에 업로드",
|
||||||
|
"sortLatest": "최신순",
|
||||||
|
"sortOldest": "오래된순",
|
||||||
|
"sortLikes": "좋아요 많은순",
|
||||||
|
"sortComments": "댓글 많은순",
|
||||||
|
"regionPlaceholder": "지역 선택",
|
||||||
|
"searchPlaceholder": "업체명 검색",
|
||||||
|
"searchBtn": "검색"
|
||||||
},
|
},
|
||||||
"businessSettings": {
|
"businessSettings": {
|
||||||
"title": "비즈니스 설정",
|
"title": "비즈니스 설정",
|
||||||
@@ -345,16 +523,20 @@
|
|||||||
"conceptScalability": "컨셉 확장성",
|
"conceptScalability": "컨셉 확장성",
|
||||||
"noInfo": "정보 없음",
|
"noInfo": "정보 없음",
|
||||||
"marketPositioning": "시장 포지셔닝",
|
"marketPositioning": "시장 포지셔닝",
|
||||||
"coreValue": "핵심 가치 (Core Value)",
|
"coreValue": "핵심 가치",
|
||||||
"categoryDefinition": "카테고리 정의",
|
"categoryDefinition": "카테고리 정의",
|
||||||
"targetPersona": "타겟 페르소나",
|
"targetPersona": "주요 고객 유형",
|
||||||
"ageSuffix": "세",
|
"ageSuffix": "세",
|
||||||
"sellingPoints": "주요 셀링 포인트 (USP)",
|
"sellingPoints": "주요 셀링 포인트",
|
||||||
"recommendedKeywords": "추천 타겟 키워드",
|
"recommendedKeywords": "추천 타겟 키워드",
|
||||||
"generateContent": "콘텐츠 생성",
|
"generateContent": "콘텐츠 생성",
|
||||||
"pageDescBefore": "을 통해 도출된 ",
|
"pageDescBefore": "을 통해 도출된 ",
|
||||||
"pageDescAfter": "의 핵심 전략입니다.",
|
"pageDescAfter": "의 핵심 전략입니다.",
|
||||||
"loadingTitle": "브랜드 분석 중"
|
"loadingTitle": "브랜드 분석 중",
|
||||||
|
"loadingStep1": "브랜드 정보를 수집하는 중...",
|
||||||
|
"loadingStep2": "수집한 데이터를 분석하는 중...",
|
||||||
|
"loadingStep3": "핵심 전략을 도출하는 중...",
|
||||||
|
"loadingStep4": "결과를 정리하는 중..."
|
||||||
},
|
},
|
||||||
"common": {
|
"common": {
|
||||||
"back": "뒤로가기",
|
"back": "뒤로가기",
|
||||||
@@ -366,14 +548,48 @@
|
|||||||
"required": "*",
|
"required": "*",
|
||||||
"unknown": "알 수 없음"
|
"unknown": "알 수 없음"
|
||||||
},
|
},
|
||||||
|
"contentCalendar": {
|
||||||
|
"title": "콘텐츠 캘린더",
|
||||||
|
"tabs": {
|
||||||
|
"all": "전체",
|
||||||
|
"completed": "완료",
|
||||||
|
"scheduled": "예약",
|
||||||
|
"failed": "실패"
|
||||||
|
},
|
||||||
|
"status": {
|
||||||
|
"completed": "완료",
|
||||||
|
"scheduled": "예약",
|
||||||
|
"failed": "실패"
|
||||||
|
},
|
||||||
|
"months": ["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],
|
||||||
|
"days": ["일","월","화","수","목","금","토"],
|
||||||
|
"yearMonth": "{{year}}년 {{month}}",
|
||||||
|
"monthDay": "{{month}} {{day}}일",
|
||||||
|
"loading": "불러오는 중...",
|
||||||
|
"noResults": "최근 결과 없음",
|
||||||
|
"noResultsDesc": "제작한 콘텐츠를 소셜 채널에 업로드해 보세요",
|
||||||
|
"ado2Contents": "ADO2 콘텐츠",
|
||||||
|
"cancel": "취소",
|
||||||
|
"retry": "재시도",
|
||||||
|
"cancelConfirm": "예약을 취소하시겠습니까?",
|
||||||
|
"cancelFailed": "취소에 실패했습니다.",
|
||||||
|
"retryFailed": "재시도에 실패했습니다.",
|
||||||
|
"completedCount": "완료 {{count}}",
|
||||||
|
"scheduledCount": "예약 {{count}}",
|
||||||
|
"failedCount": "실패 {{count}}"
|
||||||
|
},
|
||||||
|
"loginPrompt": {
|
||||||
|
"title": "로그인이 필요합니다.",
|
||||||
|
"loginBtn": "로그인"
|
||||||
|
},
|
||||||
"app": {
|
"app": {
|
||||||
"loginProcessing": "로그인 처리 중...",
|
"loginProcessing": "로그인 처리 중...",
|
||||||
"loginFailed": "로그인 처리에 실패했습니다. 다시 시도해주세요.",
|
"loginFailed": "로그인 처리에 실패했습니다. 다시 시도해주세요.",
|
||||||
"kakaoLoginFailed": "카카오 로그인에 실패했습니다. 다시 시도해주세요.",
|
"kakaoLoginFailed": "카카오 로그인에 실패했습니다. 다시 시도해주세요.",
|
||||||
"loginUrlFailed": "로그인 URL을 가져오는데 실패했습니다. 다시 시도해주세요.",
|
"loginUrlFailed": "로그인 URL을 가져오는데 실패했습니다. 다시 시도해주세요.",
|
||||||
"invalidUrl": "유효하지 않은 URL입니다. 네이버 지도 URL을 입력해주세요.",
|
"invalidUrl": "유효하지 않은 URL입니다. 네이버 지도 URL을 입력해주세요.",
|
||||||
"analysisError": "분석 중 오류가 발생했습니다. 다시 시도해주세요.",
|
"analysisError": "검색 정보를 찾을 수 없습니다. 입력 정보를 다시 확인해주세요.",
|
||||||
"autocompleteError": "업체 정보 조회에 실패했습니다.",
|
"autocompleteError": "검색 정보를 찾을 수 없습니다. 입력 정보를 다시 확인해주세요.",
|
||||||
"autocompleteGeneralError": "업체 정보 조회 중 오류가 발생했습니다. 다시 시도해주세요.",
|
"autocompleteGeneralError": "업체 정보 조회 중 오류가 발생했습니다. 다시 시도해주세요.",
|
||||||
"pageComingSoon": "{{page}} 페이지 준비 중입니다."
|
"pageComingSoon": "{{page}} 페이지 준비 중입니다."
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
|
import React, { useEffect } from 'react';
|
||||||
import React, { useState, useEffect, useRef } from 'react';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { CrawlingResponse, TargetPersona, SellingPoint } from '../../types/api';
|
import { CrawlingResponse, TargetPersona } from '../../types/api';
|
||||||
|
import { GeometricChart } from './GeometricChart';
|
||||||
|
import { useTutorial } from '../../components/Tutorial/useTutorial';
|
||||||
|
import { TUTORIAL_KEYS } from '../../components/Tutorial/tutorialSteps';
|
||||||
|
import TutorialOverlay from '../../components/Tutorial/TutorialOverlay';
|
||||||
|
|
||||||
interface AnalysisResultSectionProps {
|
interface AnalysisResultSectionProps {
|
||||||
onBack: () => void;
|
onBack: () => void;
|
||||||
@@ -9,200 +12,20 @@ interface AnalysisResultSectionProps {
|
|||||||
data: CrawlingResponse;
|
data: CrawlingResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 레이더 차트 컴포넌트
|
|
||||||
interface RadarChartProps {
|
|
||||||
data: SellingPoint[];
|
|
||||||
size?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
const RadarChart: React.FC<RadarChartProps> = ({ data, size = 360 }) => {
|
|
||||||
const [animatedScores, setAnimatedScores] = useState<number[]>(data.map(() => 0));
|
|
||||||
const [isAnimating, setIsAnimating] = useState(true);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const targetScores = data.map(item => item.score);
|
|
||||||
const duration = 1500;
|
|
||||||
const startTime = Date.now();
|
|
||||||
|
|
||||||
const animate = () => {
|
|
||||||
const elapsed = Date.now() - startTime;
|
|
||||||
const progress = Math.min(elapsed / duration, 1);
|
|
||||||
const easeProgress = 1 - Math.pow(1 - progress, 3);
|
|
||||||
|
|
||||||
const newScores = targetScores.map(target => target * easeProgress);
|
|
||||||
setAnimatedScores(newScores);
|
|
||||||
|
|
||||||
if (progress < 1) {
|
|
||||||
requestAnimationFrame(animate);
|
|
||||||
} else {
|
|
||||||
setIsAnimating(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
requestAnimationFrame(animate);
|
|
||||||
}, [data]);
|
|
||||||
|
|
||||||
const padding = 80;
|
|
||||||
const center = size / 2 + padding;
|
|
||||||
const maxRadius = size / 2 - 20;
|
|
||||||
const levels = 5;
|
|
||||||
const angleStep = (2 * Math.PI) / data.length;
|
|
||||||
|
|
||||||
const getPoint = (index: number, score: number) => {
|
|
||||||
const angle = angleStep * index - Math.PI / 2;
|
|
||||||
const radius = (score / 100) * maxRadius;
|
|
||||||
return {
|
|
||||||
x: center + radius * Math.cos(angle),
|
|
||||||
y: center + radius * Math.sin(angle),
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const dataPoints = animatedScores.map((score, i) => getPoint(i, score));
|
|
||||||
const dataPath = dataPoints.map((p, i) => (i === 0 ? `M ${p.x} ${p.y}` : `L ${p.x} ${p.y}`)).join(' ') + ' Z';
|
|
||||||
|
|
||||||
const levelPaths = Array.from({ length: levels }, (_, levelIndex) => {
|
|
||||||
const levelRadius = ((levelIndex + 1) / levels) * maxRadius;
|
|
||||||
const points = data.map((_, i) => {
|
|
||||||
const angle = angleStep * i - Math.PI / 2;
|
|
||||||
return {
|
|
||||||
x: center + levelRadius * Math.cos(angle),
|
|
||||||
y: center + levelRadius * Math.sin(angle),
|
|
||||||
};
|
|
||||||
});
|
|
||||||
return points.map((p, i) => (i === 0 ? `M ${p.x} ${p.y}` : `L ${p.x} ${p.y}`)).join(' ') + ' Z';
|
|
||||||
});
|
|
||||||
|
|
||||||
const axisLines = data.map((_, i) => {
|
|
||||||
const angle = angleStep * i - Math.PI / 2;
|
|
||||||
const endX = center + maxRadius * Math.cos(angle);
|
|
||||||
const endY = center + maxRadius * Math.sin(angle);
|
|
||||||
return `M ${center} ${center} L ${endX} ${endY}`;
|
|
||||||
});
|
|
||||||
|
|
||||||
const svgSize = size + padding * 2;
|
|
||||||
|
|
||||||
// 순위별로 정렬하여 라벨 위치에 순위 번호 배치
|
|
||||||
const sortedIndices = [...data]
|
|
||||||
.map((item, i) => ({ index: i, score: item.score }))
|
|
||||||
.sort((a, b) => b.score - a.score)
|
|
||||||
.map((item, rank) => ({ ...item, rank: rank + 1 }));
|
|
||||||
|
|
||||||
const rankMap = new Map<number, number>();
|
|
||||||
sortedIndices.forEach(item => rankMap.set(item.index, item.rank));
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="bi2-radar-container">
|
|
||||||
<svg
|
|
||||||
width={svgSize}
|
|
||||||
height={svgSize}
|
|
||||||
viewBox={`0 0 ${svgSize} ${svgSize}`}
|
|
||||||
style={{ overflow: 'visible' }}
|
|
||||||
>
|
|
||||||
{levelPaths.map((path, i) => (
|
|
||||||
<path
|
|
||||||
key={`level-${i}`}
|
|
||||||
d={path}
|
|
||||||
fill="none"
|
|
||||||
stroke="rgba(255,255,255,0.2)"
|
|
||||||
strokeWidth="1"
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
|
|
||||||
{axisLines.map((path, i) => (
|
|
||||||
<path
|
|
||||||
key={`axis-${i}`}
|
|
||||||
d={path}
|
|
||||||
fill="none"
|
|
||||||
stroke="rgba(255,255,255,0.2)"
|
|
||||||
strokeWidth="1"
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
|
|
||||||
<path
|
|
||||||
d={dataPath}
|
|
||||||
fill="rgba(45, 212, 191, 0.2)"
|
|
||||||
stroke="#2DD4BF"
|
|
||||||
strokeWidth="2"
|
|
||||||
style={{
|
|
||||||
transition: isAnimating ? 'none' : 'd 0.3s ease-out',
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{dataPoints.map((point, i) => (
|
|
||||||
<circle
|
|
||||||
key={`point-${i}`}
|
|
||||||
cx={point.x}
|
|
||||||
cy={point.y}
|
|
||||||
r="4"
|
|
||||||
fill="#2DD4BF"
|
|
||||||
stroke="#1A1A2E"
|
|
||||||
strokeWidth="2"
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
|
|
||||||
{data.map((item, i) => {
|
|
||||||
const angle = angleStep * i - Math.PI / 2;
|
|
||||||
const labelRadius = maxRadius + 40;
|
|
||||||
const pos = {
|
|
||||||
x: center + labelRadius * Math.cos(angle),
|
|
||||||
y: center + labelRadius * Math.sin(angle),
|
|
||||||
};
|
|
||||||
const rank = rankMap.get(i) || i + 1;
|
|
||||||
const isTopThree = rank <= 3;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<g key={`label-${i}`}>
|
|
||||||
<g transform={`translate(${pos.x}, ${pos.y})`}>
|
|
||||||
<rect
|
|
||||||
x="-10"
|
|
||||||
y="-10"
|
|
||||||
width="20"
|
|
||||||
height="20"
|
|
||||||
rx="4"
|
|
||||||
fill={isTopThree ? '#94FBE0' : '#206764'}
|
|
||||||
/>
|
|
||||||
<text
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
textAnchor="middle"
|
|
||||||
dominantBaseline="central"
|
|
||||||
style={{
|
|
||||||
fontSize: '12px',
|
|
||||||
fontWeight: 600,
|
|
||||||
fill: isTopThree ? '#002224' : '#94FBE0',
|
|
||||||
fontFamily: 'Pretendard',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{rank}
|
|
||||||
</text>
|
|
||||||
<text
|
|
||||||
x="16"
|
|
||||||
y="0"
|
|
||||||
textAnchor="start"
|
|
||||||
dominantBaseline="central"
|
|
||||||
style={{
|
|
||||||
fontSize: '14px',
|
|
||||||
fontWeight: 400,
|
|
||||||
fill: '#E5F1F2',
|
|
||||||
fontFamily: 'Pretendard',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{item.korean_category}
|
|
||||||
</text>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const AnalysisResultSection: React.FC<AnalysisResultSectionProps> = ({ onBack, onGenerate, data }) => {
|
const AnalysisResultSection: React.FC<AnalysisResultSectionProps> = ({ onBack, onGenerate, data }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const tutorial = useTutorial();
|
||||||
const { processed_info, marketing_analysis } = data;
|
const { processed_info, marketing_analysis } = data;
|
||||||
const containerRef = useRef<HTMLDivElement>(null);
|
|
||||||
const [buttonPosition, setButtonPosition] = useState({ left: 0, width: 0 });
|
useEffect(() => {
|
||||||
|
const timer = setTimeout(() => {
|
||||||
|
if (!tutorial.hasSeen(TUTORIAL_KEYS.ANALYSIS)) {
|
||||||
|
tutorial.startTutorial(TUTORIAL_KEYS.ANALYSIS);
|
||||||
|
}
|
||||||
|
}, 600);
|
||||||
|
return () => clearTimeout(timer);
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, []);
|
||||||
|
|
||||||
const brandIdentity = marketing_analysis?.brand_identity;
|
const brandIdentity = marketing_analysis?.brand_identity;
|
||||||
const marketPositioning = marketing_analysis?.market_positioning;
|
const marketPositioning = marketing_analysis?.market_positioning;
|
||||||
@@ -213,27 +36,8 @@ const AnalysisResultSection: React.FC<AnalysisResultSectionProps> = ({ onBack, o
|
|||||||
// 셀링 포인트를 score 내림차순으로 정렬
|
// 셀링 포인트를 score 내림차순으로 정렬
|
||||||
const sortedSellingPoints = [...sellingPoints].sort((a, b) => b.score - a.score);
|
const sortedSellingPoints = [...sellingPoints].sort((a, b) => b.score - a.score);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const updateButtonPosition = () => {
|
|
||||||
if (containerRef.current) {
|
|
||||||
const rect = containerRef.current.getBoundingClientRect();
|
|
||||||
setButtonPosition({ left: rect.left, width: rect.width });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
updateButtonPosition();
|
|
||||||
window.addEventListener('resize', updateButtonPosition);
|
|
||||||
|
|
||||||
const observer = new MutationObserver(updateButtonPosition);
|
|
||||||
observer.observe(document.body, { attributes: true, subtree: true, attributeFilter: ['class'] });
|
|
||||||
|
|
||||||
return () => {
|
|
||||||
window.removeEventListener('resize', updateButtonPosition);
|
|
||||||
observer.disconnect();
|
|
||||||
};
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
<div className="bi2-page">
|
<div className="bi2-page">
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div className="bi2-header">
|
<div className="bi2-header">
|
||||||
@@ -253,13 +57,15 @@ const AnalysisResultSection: React.FC<AnalysisResultSectionProps> = ({ onBack, o
|
|||||||
<div className="bi2-title-text">
|
<div className="bi2-title-text">
|
||||||
<h1 className="bi2-main-title">{t('analysis.pageTitle')}</h1>
|
<h1 className="bi2-main-title">{t('analysis.pageTitle')}</h1>
|
||||||
<p className="bi2-subtitle">
|
<p className="bi2-subtitle">
|
||||||
{t('analysis.pageDescHighlight')}{t('analysis.pageDescBefore')}{processed_info?.customer_name || t('analysis.defaultBrandName')}{t('analysis.pageDescAfter')}
|
<span style={{ color: 'var(--Color-mint-500, #94FBE0)' }}>{t('analysis.pageDescHighlight')}</span>{t('analysis.pageDescBefore')}{processed_info?.customer_name || t('analysis.defaultBrandName')}{t('analysis.pageDescAfter')}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<hr className="bi2-page-divider" />
|
||||||
|
|
||||||
{/* Main Content Container */}
|
{/* Main Content Container */}
|
||||||
<div ref={containerRef} className="bi2-main-container">
|
<div className="bi2-main-container">
|
||||||
{/* 매장명 & 주소 */}
|
{/* 매장명 & 주소 */}
|
||||||
<div className="bi2-store-header">
|
<div className="bi2-store-header">
|
||||||
<h2 className="bi2-store-name">{processed_info?.customer_name || t('analysis.brandNameFallback')}</h2>
|
<h2 className="bi2-store-name">{processed_info?.customer_name || t('analysis.brandNameFallback')}</h2>
|
||||||
@@ -298,7 +104,7 @@ const AnalysisResultSection: React.FC<AnalysisResultSectionProps> = ({ onBack, o
|
|||||||
{/* 레이더 차트 */}
|
{/* 레이더 차트 */}
|
||||||
<div className="bi2-selling-chart">
|
<div className="bi2-selling-chart">
|
||||||
{sellingPoints.length > 0 && (
|
{sellingPoints.length > 0 && (
|
||||||
<RadarChart data={sellingPoints} size={360} />
|
<GeometricChart data={sellingPoints} />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{/* 셀링 포인트 리스트 */}
|
{/* 셀링 포인트 리스트 */}
|
||||||
@@ -340,9 +146,11 @@ const AnalysisResultSection: React.FC<AnalysisResultSectionProps> = ({ onBack, o
|
|||||||
<div className="bi2-persona-divider"></div>
|
<div className="bi2-persona-divider"></div>
|
||||||
<div className="bi2-persona-detail grow">
|
<div className="bi2-persona-detail grow">
|
||||||
<span className="bi2-label-xs">{t('analysis.favorKeywords', { defaultValue: '선호 키워드' })}</span>
|
<span className="bi2-label-xs">{t('analysis.favorKeywords', { defaultValue: '선호 키워드' })}</span>
|
||||||
<p className="bi2-persona-detail-text">
|
<div className="bi2-persona-detail-text">
|
||||||
{persona.favor_target.join('\n')}
|
{persona.favor_target.map((item, i) => (
|
||||||
</p>
|
<p key={i}>{item}</p>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="bi2-persona-divider"></div>
|
<div className="bi2-persona-divider"></div>
|
||||||
<div className="bi2-persona-detail">
|
<div className="bi2-persona-detail">
|
||||||
@@ -369,13 +177,10 @@ const AnalysisResultSection: React.FC<AnalysisResultSectionProps> = ({ onBack, o
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 콘텐츠 생성 버튼 */}
|
{/* 콘텐츠 생성 버튼 */}
|
||||||
<div
|
<div className="bi2-bottom-button-container">
|
||||||
className="fixed bottom-8 flex justify-center z-50 pointer-events-none"
|
|
||||||
style={{ left: buttonPosition.left, width: buttonPosition.width }}
|
|
||||||
>
|
|
||||||
<button
|
<button
|
||||||
onClick={onGenerate}
|
onClick={onGenerate}
|
||||||
className="pointer-events-auto bg-brand-purple hover:bg-brand-purpleHover text-white font-bold py-3 px-12 rounded-full shadow-2xl shadow-brand-purple/40 transform hover:scale-105 transition-all duration-300 flex items-center gap-2"
|
className="bi2-generate-btn"
|
||||||
>
|
>
|
||||||
<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden className="w-5 h-5">
|
<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden className="w-5 h-5">
|
||||||
<path d="M12 2l2.4 6.8L22 12l-7.6 3.2L12 22l-2.4-6.8L2 12l7.6-3.2L12 2z" />
|
<path d="M12 2l2.4 6.8L22 12l-7.6 3.2L12 22l-2.4-6.8L2 12l7.6-3.2L12 2z" />
|
||||||
@@ -384,6 +189,18 @@ const AnalysisResultSection: React.FC<AnalysisResultSectionProps> = ({ onBack, o
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{tutorial.isActive && (
|
||||||
|
<TutorialOverlay
|
||||||
|
hints={tutorial.hints}
|
||||||
|
currentIndex={tutorial.currentHintIndex}
|
||||||
|
onNext={tutorial.nextHint}
|
||||||
|
onPrev={tutorial.prevHint}
|
||||||
|
onSkip={tutorial.skipTutorial}
|
||||||
|
groupProgress={tutorial.groupProgress}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,149 +1,208 @@
|
|||||||
import React from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
|
import { SellingPoint } from '../../types/api';
|
||||||
export interface USP {
|
|
||||||
label: string;
|
|
||||||
subLabel: string;
|
|
||||||
score: number;
|
|
||||||
description: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface GeometricChartProps {
|
interface GeometricChartProps {
|
||||||
data: USP[];
|
data: SellingPoint[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const GeometricChart: React.FC<GeometricChartProps> = ({ data }) => {
|
export const GeometricChart: React.FC<GeometricChartProps> = ({ data }) => {
|
||||||
const size = 500;
|
const [animatedScores, setAnimatedScores] = useState<number[]>(data.map(() => 0));
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const targetScores = data.map(item => item.score);
|
||||||
|
const duration = 1500;
|
||||||
|
const startTime = Date.now();
|
||||||
|
|
||||||
|
const animate = () => {
|
||||||
|
const elapsed = Date.now() - startTime;
|
||||||
|
const progress = Math.min(elapsed / duration, 1);
|
||||||
|
const easeProgress = 1 - Math.pow(1 - progress, 3);
|
||||||
|
setAnimatedScores(targetScores.map(t => t * easeProgress));
|
||||||
|
if (progress < 1) requestAnimationFrame(animate);
|
||||||
|
};
|
||||||
|
|
||||||
|
requestAnimationFrame(animate);
|
||||||
|
}, [data]);
|
||||||
|
|
||||||
|
const size = 560;
|
||||||
const center = size / 2;
|
const center = size / 2;
|
||||||
const radius = 110;
|
const maxRadius = 160;
|
||||||
const sides = data.length;
|
const sides = data.length;
|
||||||
|
const levels = 5;
|
||||||
|
const angleStep = (Math.PI * 2) / sides;
|
||||||
|
|
||||||
const accentColor = "#94FBE0";
|
const getAngle = (i: number) => angleStep * i - Math.PI / 2;
|
||||||
|
const getPoint = (i: number, r: number) => ({
|
||||||
const getPoints = (r: number) => {
|
x: center + r * Math.cos(getAngle(i)),
|
||||||
return data.map((_, i) => {
|
y: center + r * Math.sin(getAngle(i)),
|
||||||
const angle = (Math.PI * 2 * i) / sides - Math.PI / 2;
|
|
||||||
const x = center + r * Math.cos(angle);
|
|
||||||
const y = center + r * Math.sin(angle);
|
|
||||||
return `${x},${y}`;
|
|
||||||
}).join(' ');
|
|
||||||
};
|
|
||||||
|
|
||||||
const getDataPoints = () => {
|
|
||||||
return data.map((item, i) => {
|
|
||||||
const normalizedScore = item.score / 100;
|
|
||||||
const r = radius * normalizedScore;
|
|
||||||
const angle = (Math.PI * 2 * i) / sides - Math.PI / 2;
|
|
||||||
const x = center + r * Math.cos(angle);
|
|
||||||
const y = center + r * Math.sin(angle);
|
|
||||||
return `${x},${y}`;
|
|
||||||
}).join(' ');
|
|
||||||
};
|
|
||||||
|
|
||||||
const labelRadius = radius + 55;
|
|
||||||
const labels = data.map((item, i) => {
|
|
||||||
const angle = (Math.PI * 2 * i) / sides - Math.PI / 2;
|
|
||||||
const x = center + labelRadius * Math.cos(angle);
|
|
||||||
const y = center + labelRadius * Math.sin(angle);
|
|
||||||
|
|
||||||
let anchor: 'start' | 'middle' | 'end' = 'middle';
|
|
||||||
if (x < center - 20) anchor = 'end';
|
|
||||||
if (x > center + 20) anchor = 'start';
|
|
||||||
|
|
||||||
return { x, y, text: item.label, sub: item.subLabel, anchor, score: item.score };
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 순위 매핑
|
||||||
|
const sortedIndices = [...data]
|
||||||
|
.map((item, i) => ({ index: i, score: item.score }))
|
||||||
|
.sort((a, b) => b.score - a.score)
|
||||||
|
.map((item, rank) => ({ ...item, rank: rank + 1 }));
|
||||||
|
const rankMap = new Map<number, number>();
|
||||||
|
sortedIndices.forEach(item => rankMap.set(item.index, item.rank));
|
||||||
|
|
||||||
|
// 레벨 폴리곤
|
||||||
|
const levelPolygons = Array.from({ length: levels }, (_, li) => {
|
||||||
|
const r = ((li + 1) / levels) * maxRadius;
|
||||||
|
return data.map((_, i) => {
|
||||||
|
const p = getPoint(i, r);
|
||||||
|
return `${p.x},${p.y}`;
|
||||||
|
}).join(' ');
|
||||||
|
});
|
||||||
|
|
||||||
|
// 데이터 폴리곤
|
||||||
|
const dataPolygon = animatedScores.map((score, i) => {
|
||||||
|
const r = (score / 100) * maxRadius;
|
||||||
|
const p = getPoint(i, r);
|
||||||
|
return `${p.x},${p.y}`;
|
||||||
|
}).join(' ');
|
||||||
|
|
||||||
|
// 데이터 포인트
|
||||||
|
const dataPoints = animatedScores.map((score, i) => {
|
||||||
|
const r = (score / 100) * maxRadius;
|
||||||
|
return getPoint(i, r);
|
||||||
|
});
|
||||||
|
|
||||||
|
const labelRadius = maxRadius + 22;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col items-center justify-center py-2 relative w-full h-full">
|
<div className="bi2-radar-container">
|
||||||
<svg viewBox={`0 0 ${size} ${size}`} className="w-full h-auto max-w-[500px]" style={{ overflow: 'visible' }}>
|
<svg
|
||||||
|
viewBox={`0 0 ${size} ${size}`}
|
||||||
|
style={{ overflow: 'visible', width: '440px', height: '440px' }}
|
||||||
|
>
|
||||||
<defs>
|
<defs>
|
||||||
<radialGradient id="polyGradient" cx="50%" cy="50%" r="50%" fx="50%" fy="50%">
|
{/* 레이더 폴리곤 fill: radial gradient */}
|
||||||
<stop offset="0%" stopColor={accentColor} stopOpacity="0.3" />
|
<radialGradient id="radar-fill-gradient" cx="280" cy="280" r="160" fx="280" fy="280" gradientUnits="userSpaceOnUse">
|
||||||
<stop offset="100%" stopColor={accentColor} stopOpacity="0.05" />
|
<stop offset="60%" stopColor="#034245" stopOpacity="0" />
|
||||||
|
<stop offset="100%" stopColor="#94FBE0" stopOpacity="0.30" />
|
||||||
</radialGradient>
|
</radialGradient>
|
||||||
|
{/* 레이더 폴리곤 filter: outer drop-shadow + inset glow */}
|
||||||
|
<filter id="radar-polygon-filter" x="-30%" y="-30%" width="160%" height="160%">
|
||||||
|
{/* Outer drop shadow */}
|
||||||
|
<feDropShadow dx="0" dy="0" stdDeviation="6" floodColor="#94FBE0" floodOpacity="0.5" result="dropShadow" />
|
||||||
|
{/* Inset glow: invert alpha → blur → composite inside */}
|
||||||
|
<feComponentTransfer in="SourceAlpha" result="invertedAlpha">
|
||||||
|
<feFuncA type="linear" slope="-1" intercept="1" />
|
||||||
|
</feComponentTransfer>
|
||||||
|
<feGaussianBlur in="invertedAlpha" stdDeviation="6" result="blurredOuter" />
|
||||||
|
<feComposite in="blurredOuter" in2="SourceAlpha" operator="in" result="insetMask" />
|
||||||
|
<feFlood floodColor="#94FBE0" floodOpacity="0.5" result="insetColor" />
|
||||||
|
<feComposite in="insetColor" in2="insetMask" operator="in" result="insetGlow" />
|
||||||
|
<feMerge>
|
||||||
|
<feMergeNode in="dropShadow" />
|
||||||
|
<feMergeNode in="SourceGraphic" />
|
||||||
|
<feMergeNode in="insetGlow" />
|
||||||
|
</feMerge>
|
||||||
|
</filter>
|
||||||
|
<filter id="badge-glow" x="-50%" y="-50%" width="200%" height="200%">
|
||||||
|
<feDropShadow dx="0" dy="0" stdDeviation="4" floodColor="#94FBE0" floodOpacity="0.4" />
|
||||||
|
</filter>
|
||||||
</defs>
|
</defs>
|
||||||
|
|
||||||
{[1, 0.75, 0.5, 0.25].map((scale, i) => (
|
{/* 그리드 레벨 */}
|
||||||
|
{levelPolygons.map((points, i) => (
|
||||||
<polygon
|
<polygon
|
||||||
key={i}
|
key={`level-${i}`}
|
||||||
points={getPoints(radius * scale)}
|
points={points}
|
||||||
fill="none"
|
fill="none"
|
||||||
stroke={accentColor}
|
stroke="rgba(255,255,255,0.2)"
|
||||||
strokeOpacity={0.25 - (0.02 * i)}
|
|
||||||
strokeWidth="1"
|
strokeWidth="1"
|
||||||
strokeDasharray={i === 0 ? "0" : "4 2"}
|
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
|
{/* 축 선 */}
|
||||||
{data.map((_, i) => {
|
{data.map((_, i) => {
|
||||||
const angle = (Math.PI * 2 * i) / sides - Math.PI / 2;
|
const p = getPoint(i, maxRadius);
|
||||||
const x = center + radius * Math.cos(angle);
|
|
||||||
const y = center + radius * Math.sin(angle);
|
|
||||||
return (
|
return (
|
||||||
<line
|
<line
|
||||||
key={i}
|
key={`axis-${i}`}
|
||||||
x1={center}
|
x1={center}
|
||||||
y1={center}
|
y1={center}
|
||||||
x2={x}
|
x2={p.x}
|
||||||
y2={y}
|
y2={p.y}
|
||||||
stroke={accentColor}
|
stroke="rgba(255,255,255,0.2)"
|
||||||
strokeOpacity="0.25"
|
|
||||||
strokeWidth="1"
|
strokeWidth="1"
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|
||||||
|
{/* 데이터 폴리곤 */}
|
||||||
<polygon
|
<polygon
|
||||||
points={getDataPoints()}
|
points={dataPolygon}
|
||||||
fill="url(#polyGradient)"
|
fill="url(#radar-fill-gradient)"
|
||||||
stroke={accentColor}
|
stroke="var(--Color-mint-500, #94FBE0)"
|
||||||
strokeWidth="2.5"
|
strokeWidth="2"
|
||||||
strokeLinejoin="round"
|
strokeLinejoin="round"
|
||||||
|
filter="url(#radar-polygon-filter)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{/* 데이터 포인트 */}
|
||||||
|
{dataPoints.map((point, i) => (
|
||||||
|
<circle
|
||||||
|
key={`point-${i}`}
|
||||||
|
cx={point.x}
|
||||||
|
cy={point.y}
|
||||||
|
r="4"
|
||||||
|
fill="#ffffff"
|
||||||
|
stroke="#ffffff"
|
||||||
|
strokeWidth="2"
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
|
||||||
|
{/* 라벨 */}
|
||||||
{data.map((item, i) => {
|
{data.map((item, i) => {
|
||||||
const normalizedScore = item.score / 100;
|
const angle = getAngle(i);
|
||||||
const r = radius * normalizedScore;
|
const pos = getPoint(i, labelRadius);
|
||||||
const angle = (Math.PI * 2 * i) / sides - Math.PI / 2;
|
const rank = rankMap.get(i) || i + 1;
|
||||||
const x = center + r * Math.cos(angle);
|
const isTopThree = rank <= 3;
|
||||||
const y = center + r * Math.sin(angle);
|
const isLeftSide = Math.cos(angle) < -0.1;
|
||||||
const isHigh = item.score >= 90;
|
const textX = isLeftSide ? -20 : 20;
|
||||||
return (
|
const textAnchor: 'start' | 'end' = isLeftSide ? 'end' : 'start';
|
||||||
<g key={i}>
|
|
||||||
{isHigh && (
|
|
||||||
<circle cx={x} cy={y} r="10" fill={accentColor} fillOpacity="0.4" />
|
|
||||||
)}
|
|
||||||
<circle cx={x} cy={y} r={isHigh ? 5 : 4} fill="#fff" />
|
|
||||||
</g>
|
|
||||||
)
|
|
||||||
})}
|
|
||||||
|
|
||||||
{labels.map((l, i) => {
|
|
||||||
const isHigh = l.score >= 90;
|
|
||||||
return (
|
return (
|
||||||
<g key={i}>
|
<g key={`label-${i}`}>
|
||||||
<text
|
<g transform={`translate(${pos.x}, ${pos.y})`}>
|
||||||
x={l.x}
|
{isLeftSide && (
|
||||||
y={l.y - 7}
|
<text
|
||||||
textAnchor={l.anchor}
|
x={textX}
|
||||||
fill={isHigh ? "#fff" : "#e2e8f0"}
|
y="0"
|
||||||
fontSize={isHigh ? "14" : "12"}
|
textAnchor={textAnchor}
|
||||||
fontWeight={isHigh ? "700" : "600"}
|
dominantBaseline="central"
|
||||||
className="tracking-tight"
|
className="bi2-radar-label-text"
|
||||||
style={{ fontFamily: "sans-serif" }}
|
style={{ fontSize: '20px', fontWeight: 600, fill: '#E5F1F2', fontFamily: 'Pretendard' }}
|
||||||
>
|
>
|
||||||
{l.text}
|
{item.korean_category}
|
||||||
</text>
|
</text>
|
||||||
<text
|
)}
|
||||||
x={l.x}
|
<g filter={isTopThree ? 'url(#badge-glow)' : undefined}>
|
||||||
y={l.y + 9}
|
<rect x="-12.5" y="-12.5" width="25" height="25" rx="4" fill={isTopThree ? '#94FBE0' : '#206764'} />
|
||||||
textAnchor={l.anchor}
|
<text
|
||||||
fill={isHigh ? accentColor : "#94a3b8"}
|
x="0" y="0"
|
||||||
fontSize={isHigh ? "11" : "10"}
|
textAnchor="middle"
|
||||||
fontWeight={isHigh ? "600" : "400"}
|
dominantBaseline="central"
|
||||||
className="uppercase tracking-wider"
|
style={{ fontSize: '16px', fontWeight: 600, fill: isTopThree ? '#002224' : '#94FBE0', fontFamily: 'Pretendard' }}
|
||||||
>
|
>
|
||||||
{l.sub}
|
{rank}
|
||||||
</text>
|
</text>
|
||||||
|
</g>
|
||||||
|
{!isLeftSide && (
|
||||||
|
<text
|
||||||
|
x={textX}
|
||||||
|
y="0"
|
||||||
|
textAnchor={textAnchor}
|
||||||
|
dominantBaseline="central"
|
||||||
|
className="bi2-radar-label-text"
|
||||||
|
style={{ fontSize: '20px', fontWeight: 600, fill: '#E5F1F2', fontFamily: 'Pretendard' }}
|
||||||
|
>
|
||||||
|
{item.korean_category}
|
||||||
|
</text>
|
||||||
|
)}
|
||||||
|
</g>
|
||||||
</g>
|
</g>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -1,15 +1,56 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
const LoadingSection: React.FC = () => {
|
interface LoadingSectionProps {
|
||||||
|
onComplete?: () => void;
|
||||||
|
isComplete?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
const LoadingSection: React.FC<LoadingSectionProps> = ({ onComplete, isComplete }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const [progress, setProgress] = useState(0);
|
||||||
|
const intervalRef = useRef<ReturnType<typeof setInterval> | null>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
intervalRef.current = setInterval(() => {
|
||||||
|
setProgress(prev => {
|
||||||
|
if (prev >= 100) {
|
||||||
|
if (intervalRef.current) clearInterval(intervalRef.current);
|
||||||
|
return 100;
|
||||||
|
}
|
||||||
|
const increment = prev < 70 ? 0.5 : prev < 90 ? 0.2 : 0.1;
|
||||||
|
return Math.min(prev + increment, 100);
|
||||||
|
});
|
||||||
|
}, 100);
|
||||||
|
return () => {
|
||||||
|
if (intervalRef.current) clearInterval(intervalRef.current);
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!isComplete) return;
|
||||||
|
if (intervalRef.current) clearInterval(intervalRef.current);
|
||||||
|
setProgress(100);
|
||||||
|
const timer = setTimeout(() => {
|
||||||
|
onComplete?.();
|
||||||
|
}, 400);
|
||||||
|
return () => clearTimeout(timer);
|
||||||
|
}, [isComplete]);
|
||||||
|
|
||||||
|
const getStepMessage = (p: number) => {
|
||||||
|
if (p < 30) return t('analysis.loadingStep1');
|
||||||
|
if (p < 50) return t('analysis.loadingStep2');
|
||||||
|
if (p < 80) return t('analysis.loadingStep3');
|
||||||
|
return t('analysis.loadingStep4');
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="loading-container">
|
<div className="loading-container">
|
||||||
<div className="loading-content">
|
<div className="loading-content">
|
||||||
{/* Logo */}
|
{/* Logo */}
|
||||||
<div className="loading-logo">
|
<div className="loading-logo">
|
||||||
<img src="/assets/images/ado2-loading-logo.svg" alt="ADO2" />
|
<img src="/assets/images/ADO2_with Slogan_white.svg" alt="ADO2" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Loading Spinner and Text */}
|
{/* Loading Spinner and Text */}
|
||||||
@@ -23,6 +64,17 @@ const LoadingSection: React.FC = () => {
|
|||||||
className="loading-spinner-icon"
|
className="loading-spinner-icon"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="loading-progress-wrapper">
|
||||||
|
<div className="loading-progress-bar">
|
||||||
|
<div
|
||||||
|
className="loading-progress-fill"
|
||||||
|
style={{ width: `${progress}%` }}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<span className="loading-progress-text">{Math.floor(progress)}%</span>
|
||||||
|
</div>
|
||||||
|
<p className="loading-step-message">{getStepMessage(progress)}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,148 +1,127 @@
|
|||||||
|
|
||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { getVideosList, deleteVideo } from '../../utils/api';
|
import { getAllVideos, isLoggedIn } from '../../utils/api';
|
||||||
import { VideoListItem } from '../../types/api';
|
import { VideoListItem } from '../../types/api';
|
||||||
import SocialPostingModal from '../../components/SocialPostingModal';
|
import LoginPromptModal from '../../components/LoginPromptModal';
|
||||||
|
import VideoDetailModal from '../../components/VideoDetailModal';
|
||||||
|
import CitySelectModal from '../../components/CitySelectModal';
|
||||||
|
|
||||||
interface ADO2ContentsPageProps {
|
interface ADO2ContentsPageProps {
|
||||||
onBack: () => void;
|
onBack?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = ({ onBack }) => {
|
const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const authed = isLoggedIn();
|
||||||
|
const [selectedVideoId, setSelectedVideoId] = useState<number | null>(null);
|
||||||
const [videos, setVideos] = useState<VideoListItem[]>([]);
|
const [videos, setVideos] = useState<VideoListItem[]>([]);
|
||||||
const [total, setTotal] = useState(0);
|
const [total, setTotal] = useState(0);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(authed);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
const [page, setPage] = useState(1);
|
const [page, setPage] = useState(1);
|
||||||
const [hasNext, setHasNext] = useState(false);
|
const [hasNext, setHasNext] = useState(false);
|
||||||
const [hasPrev, setHasPrev] = useState(false);
|
const [hasPrev, setHasPrev] = useState(false);
|
||||||
const [totalPages, setTotalPages] = useState(1);
|
const [totalPages, setTotalPages] = useState(1);
|
||||||
const [deleteModalOpen, setDeleteModalOpen] = useState(false);
|
|
||||||
const [deleteTargetId, setDeleteTargetId] = useState<number | null>(null);
|
|
||||||
const [isDeleting, setIsDeleting] = useState(false);
|
|
||||||
const [uploadModalOpen, setUploadModalOpen] = useState(false);
|
|
||||||
const [uploadTargetVideo, setUploadTargetVideo] = useState<VideoListItem | null>(null);
|
|
||||||
|
|
||||||
const pageSize = 12;
|
const pageSize = 20;
|
||||||
|
const [sortBy, setSortBy] = useState<'created_at' | 'like_count' | 'comment_count'>('created_at');
|
||||||
|
const [order, setOrder] = useState<'desc' | 'asc'>('desc');
|
||||||
|
const [searchInput, setSearchInput] = useState('');
|
||||||
|
const [storeName, setStoreName] = useState('');
|
||||||
|
const [region, setRegion] = useState('');
|
||||||
|
const [showCityModal, setShowCityModal] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (!authed) return;
|
||||||
fetchVideos();
|
fetchVideos();
|
||||||
}, [page]);
|
}, [page, sortBy, order, storeName, region]);
|
||||||
|
|
||||||
const fetchVideos = async () => {
|
const fetchVideos = async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
setError(null);
|
setError(null);
|
||||||
try {
|
try {
|
||||||
const response = await getVideosList(page, pageSize);
|
const response = await getAllVideos(page, pageSize, sortBy, storeName, order, region);
|
||||||
console.log('[ADO2] API response:', response);
|
setVideos(response.items);
|
||||||
console.log('[ADO2] First video item:', response.items[0]);
|
|
||||||
// result_movie_url이 있는 비디오만 필터링 (빈/더미 데이터 제외)
|
|
||||||
const validVideos = response.items.filter(video => video.result_movie_url && video.result_movie_url.trim() !== '');
|
|
||||||
setVideos(validVideos);
|
|
||||||
setTotal(response.total);
|
setTotal(response.total);
|
||||||
setTotalPages(response.total_pages);
|
setTotalPages(response.total_pages);
|
||||||
setHasNext(response.has_next);
|
setHasNext(response.has_next);
|
||||||
setHasPrev(response.has_prev);
|
setHasPrev(response.has_prev);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Failed to fetch videos:', err);
|
console.error('Failed to fetch all videos:', err);
|
||||||
setError(t('ado2Contents.loadFailed'));
|
setError(t('ado2Contents.loadFailed'));
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleCardClick = (videoId: number) => {
|
||||||
|
setSelectedVideoId(videoId);
|
||||||
|
};
|
||||||
|
|
||||||
const formatDate = (dateString: string) => {
|
const formatDate = (dateString: string) => {
|
||||||
const date = new Date(dateString);
|
const date = new Date(dateString);
|
||||||
const year = date.getFullYear();
|
const year = date.getFullYear();
|
||||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||||
const day = String(date.getDate()).padStart(2, '0');
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
const hours = String(date.getHours()).padStart(2, '0');
|
return `${year}.${month}.${day}`;
|
||||||
const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
||||||
return `${year}.${month}.${day}・${hours}:${minutes}`;
|
|
||||||
};
|
|
||||||
|
|
||||||
const formatTitle = (storeName: string, dateString: string) => {
|
|
||||||
const date = new Date(dateString);
|
|
||||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
||||||
const day = String(date.getDate()).padStart(2, '0');
|
|
||||||
const hours = String(date.getHours()).padStart(2, '0');
|
|
||||||
const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
||||||
return `${storeName} ${month}/${day} ${hours}:${minutes}`;
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleDownload = async (videoUrl: string, storeName: string) => {
|
|
||||||
try {
|
|
||||||
const response = await fetch(videoUrl);
|
|
||||||
const blob = await response.blob();
|
|
||||||
const url = window.URL.createObjectURL(blob);
|
|
||||||
const a = document.createElement('a');
|
|
||||||
a.href = url;
|
|
||||||
a.download = `${storeName}.mp4`;
|
|
||||||
document.body.appendChild(a);
|
|
||||||
a.click();
|
|
||||||
window.URL.revokeObjectURL(url);
|
|
||||||
document.body.removeChild(a);
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Download failed:', err);
|
|
||||||
alert(t('ado2Contents.downloadFailed'));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleDeleteClick = (videoId: number) => {
|
|
||||||
setDeleteTargetId(videoId);
|
|
||||||
setDeleteModalOpen(true);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleUploadClick = (video: VideoListItem) => {
|
|
||||||
console.log('[ADO2] Upload clicked - video object:', video);
|
|
||||||
console.log('[ADO2] video.video_id:', video.video_id);
|
|
||||||
setUploadTargetVideo(video);
|
|
||||||
setUploadModalOpen(true);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleUploadModalClose = () => {
|
|
||||||
setUploadModalOpen(false);
|
|
||||||
setUploadTargetVideo(null);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleDeleteCancel = () => {
|
|
||||||
setDeleteModalOpen(false);
|
|
||||||
setDeleteTargetId(null);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleDeleteConfirm = async () => {
|
|
||||||
if (!deleteTargetId) return;
|
|
||||||
setIsDeleting(true);
|
|
||||||
try {
|
|
||||||
await deleteVideo(deleteTargetId);
|
|
||||||
|
|
||||||
// 삭제 성공 시 로컬 상태에서 즉시 제거 (UI 즉시 반영)
|
|
||||||
// fetchVideos()를 호출하지 않음 - 서버 캐시 또는 동기화 지연으로 인해
|
|
||||||
// 삭제된 항목이 다시 나타날 수 있기 때문
|
|
||||||
setVideos(prev => prev.filter(video => video.video_id !== deleteTargetId));
|
|
||||||
setTotal(prev => Math.max(0, prev - 1));
|
|
||||||
|
|
||||||
setDeleteModalOpen(false);
|
|
||||||
setDeleteTargetId(null);
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Delete failed:', err);
|
|
||||||
alert(t('ado2Contents.deleteFailed'));
|
|
||||||
} finally {
|
|
||||||
setIsDeleting(false);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="ado2-contents-page">
|
<div className="ado2-contents-page">
|
||||||
{/* Header */}
|
|
||||||
<div className="ado2-contents-header">
|
<div className="ado2-contents-header">
|
||||||
<h1 className="ado2-contents-title">{t('ado2Contents.title')}</h1>
|
<h1 className="ado2-contents-title">{t('sidebar.ado2Contents')}</h1>
|
||||||
<span className="ado2-contents-count">{t('ado2Contents.totalCount', { count: total })}</span>
|
<span className="ado2-contents-count">{t('ado2Contents.totalCount', { count: total })}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Content Grid */}
|
<div className="ado2-contents-filters">
|
||||||
|
<select
|
||||||
|
className="ado2-filter-select"
|
||||||
|
value={`${sortBy}__${order}`}
|
||||||
|
onChange={(e) => {
|
||||||
|
const [sb, ord] = e.target.value.split('__') as [typeof sortBy, typeof order];
|
||||||
|
setSortBy(sb);
|
||||||
|
setOrder(ord);
|
||||||
|
setPage(1);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<option value="created_at__desc">{t('ado2Contents.sortLatest')}</option>
|
||||||
|
<option value="created_at__asc">{t('ado2Contents.sortOldest')}</option>
|
||||||
|
<option value="like_count__desc">{t('ado2Contents.sortLikes')}</option>
|
||||||
|
<option value="comment_count__desc">{t('ado2Contents.sortComments')}</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className={`ado2-region-pill ${region ? 'active' : ''}`}
|
||||||
|
onClick={() => setShowCityModal(true)}
|
||||||
|
>
|
||||||
|
{region || t('ado2Contents.regionPlaceholder')}
|
||||||
|
{region && (
|
||||||
|
<span className="ado2-region-clear" onClick={(e) => { e.stopPropagation(); setRegion(''); setPage(1); }}>✕</span>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<form
|
||||||
|
className="ado2-filter-search"
|
||||||
|
onSubmit={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
setStoreName(searchInput);
|
||||||
|
setPage(1);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
className="ado2-filter-input"
|
||||||
|
value={searchInput}
|
||||||
|
onChange={(e) => setSearchInput(e.target.value)}
|
||||||
|
placeholder={t('ado2Contents.searchPlaceholder')}
|
||||||
|
/>
|
||||||
|
<button type="submit" className="ado2-filter-btn">
|
||||||
|
{t('ado2Contents.searchBtn')}
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<div className="ado2-contents-loading">
|
<div className="ado2-contents-loading">
|
||||||
<div className="loading-spinner"></div>
|
<div className="loading-spinner"></div>
|
||||||
@@ -161,89 +140,64 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = ({ onBack }) => {
|
|||||||
<>
|
<>
|
||||||
<div className="ado2-contents-grid">
|
<div className="ado2-contents-grid">
|
||||||
{videos.map((video) => (
|
{videos.map((video) => (
|
||||||
<div key={video.task_id} className="ado2-content-card">
|
<div
|
||||||
{/* Video Thumbnail */}
|
key={video.video_id}
|
||||||
<div className="content-card-thumbnail">
|
className="ado2-content-card"
|
||||||
{video.result_movie_url ? (
|
style={{ cursor: 'pointer' }}
|
||||||
|
onClick={() => handleCardClick(video.video_id)}
|
||||||
|
role="button"
|
||||||
|
tabIndex={0}
|
||||||
|
onKeyDown={(e) => e.key === 'Enter' && handleCardClick(video.video_id)}
|
||||||
|
>
|
||||||
|
<div className="content-card-thumbnail ado2-gallery-thumbnail-wrap">
|
||||||
|
{video.thumbnail_url ? (
|
||||||
|
<img
|
||||||
|
src={video.thumbnail_url}
|
||||||
|
alt={video.store_name}
|
||||||
|
style={{ width: '100%', height: '100%', objectFit: 'cover' }}
|
||||||
|
/>
|
||||||
|
) : video.result_movie_url ? (
|
||||||
<video
|
<video
|
||||||
src={video.result_movie_url}
|
src={video.result_movie_url}
|
||||||
className="content-video-preview"
|
className="content-video-preview"
|
||||||
|
preload="metadata"
|
||||||
muted
|
muted
|
||||||
playsInline
|
playsInline
|
||||||
onMouseEnter={(e) => e.currentTarget.play()}
|
|
||||||
onMouseLeave={(e) => {
|
|
||||||
e.currentTarget.pause();
|
|
||||||
e.currentTarget.currentTime = 0;
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div className="content-no-video">
|
<div className="content-no-video" />
|
||||||
<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
|
)}
|
||||||
<rect x="2" y="2" width="20" height="20" rx="2.18" ry="2.18"/>
|
{/* 호버 오버레이 */}
|
||||||
<line x1="7" y1="2" x2="7" y2="22"/>
|
<div className="ado2-gallery-overlay">
|
||||||
<line x1="17" y1="2" x2="17" y2="22"/>
|
<div className="ado2-gallery-play-btn">
|
||||||
<line x1="2" y1="12" x2="22" y2="12"/>
|
<svg width="28" height="28" viewBox="0 0 24 24" fill="currentColor">
|
||||||
<line x1="2" y1="7" x2="7" y2="7"/>
|
<polygon points="5,3 19,12 5,21"/>
|
||||||
<line x1="2" y1="17" x2="7" y2="17"/>
|
|
||||||
<line x1="17" y1="17" x2="22" y2="17"/>
|
|
||||||
<line x1="17" y1="7" x2="22" y2="7"/>
|
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
)}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Card Info */}
|
|
||||||
<div className="content-card-info">
|
<div className="content-card-info">
|
||||||
<div className="content-card-text">
|
<div className="content-card-text">
|
||||||
<h3 className="content-card-title">
|
<h3 className="content-card-title">{video.store_name}</h3>
|
||||||
{formatTitle(video.store_name, video.created_at)}
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
||||||
</h3>
|
<p className="content-card-date">{formatDate(video.created_at)}</p>
|
||||||
<p className="content-card-date">
|
<span className="content-card-like">
|
||||||
{formatDate(video.created_at)}
|
<svg width="15" height="15" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" strokeWidth="2">
|
||||||
</p>
|
<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/>
|
||||||
</div>
|
</svg>
|
||||||
|
{video.like_count ?? 0}
|
||||||
{/* Action Buttons */}
|
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" style={{ marginLeft: '6px' }}>
|
||||||
<div className="content-card-actions">
|
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>
|
||||||
<button
|
</svg>
|
||||||
className="content-download-btn"
|
{video.comment_count ?? 0}
|
||||||
onClick={() => handleUploadClick(video)}
|
</span>
|
||||||
disabled={!video.result_movie_url}
|
</div>
|
||||||
>
|
|
||||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.5">
|
|
||||||
<path d="M10 13V3M10 3l-4 4M10 3l4 4"/>
|
|
||||||
<path d="M3 15v2h14v-2"/>
|
|
||||||
</svg>
|
|
||||||
<span>{t('ado2Contents.uploadToSocial')}</span>
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
className="content-upload-btn"
|
|
||||||
onClick={() => handleDownload(video.result_movie_url, video.store_name)}
|
|
||||||
disabled={!video.result_movie_url}
|
|
||||||
title={t('ado2Contents.download')}
|
|
||||||
>
|
|
||||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.5">
|
|
||||||
<path d="M10 3v10M10 13l-4-4M10 13l4-4"/>
|
|
||||||
<path d="M3 15v2h14v-2"/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
className="content-delete-btn"
|
|
||||||
onClick={() => handleDeleteClick(video.video_id)}
|
|
||||||
>
|
|
||||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.5">
|
|
||||||
<path d="M3 5h14M8 5V3h4v2M6 5v12h8V5"/>
|
|
||||||
<line x1="8" y1="8" x2="8" y2="14"/>
|
|
||||||
<line x1="12" y1="8" x2="12" y2="14"/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Pagination - 항상 표시 */}
|
|
||||||
<div className="ado2-contents-pagination">
|
<div className="ado2-contents-pagination">
|
||||||
<button
|
<button
|
||||||
className="pagination-btn"
|
className="pagination-btn"
|
||||||
@@ -264,38 +218,24 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = ({ onBack }) => {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* 삭제 확인 모달 */}
|
{!authed && (
|
||||||
{deleteModalOpen && (
|
<LoginPromptModal onClose={() => { window.location.href = '/'; }} />
|
||||||
<div className="delete-modal-overlay" onClick={handleDeleteCancel}>
|
|
||||||
<div className="delete-modal" onClick={(e: React.MouseEvent) => e.stopPropagation()}>
|
|
||||||
<h2 className="delete-modal-title">{t('ado2Contents.deleteConfirmTitle')}</h2>
|
|
||||||
<p className="delete-modal-description">{t('ado2Contents.deleteConfirmDesc')}</p>
|
|
||||||
<div className="delete-modal-actions">
|
|
||||||
<button
|
|
||||||
className="delete-modal-btn cancel"
|
|
||||||
onClick={handleDeleteCancel}
|
|
||||||
disabled={isDeleting}
|
|
||||||
>
|
|
||||||
{t('ado2Contents.cancel')}
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
className="delete-modal-btn confirm"
|
|
||||||
onClick={handleDeleteConfirm}
|
|
||||||
disabled={isDeleting}
|
|
||||||
>
|
|
||||||
{isDeleting ? t('ado2Contents.deleting') : t('ado2Contents.delete')}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* 소셜 미디어 업로드 모달 */}
|
{selectedVideoId !== null && (
|
||||||
<SocialPostingModal
|
<VideoDetailModal
|
||||||
isOpen={uploadModalOpen}
|
videoId={String(selectedVideoId)}
|
||||||
onClose={handleUploadModalClose}
|
onClose={() => setSelectedVideoId(null)}
|
||||||
video={uploadTargetVideo}
|
/>
|
||||||
/>
|
)}
|
||||||
|
|
||||||
|
{showCityModal && (
|
||||||
|
<CitySelectModal
|
||||||
|
selected={region}
|
||||||
|
onSelect={(city) => { setRegion(city); setPage(1); }}
|
||||||
|
onClose={() => setShowCityModal(false)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,14 +1,18 @@
|
|||||||
|
|
||||||
import React, { useState, useEffect, useRef } from 'react';
|
import React, { useState, useEffect, useRef } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { generateVideo, waitForVideoComplete } from '../../utils/api';
|
import { generateVideo, waitForVideoComplete, getSubtitleStatus, waitForSubtitleComplete } from '../../utils/api';
|
||||||
import SocialPostingModal from '../../components/SocialPostingModal';
|
import SocialPostingModal from '../../components/SocialPostingModal';
|
||||||
|
import { useTutorial } from '../../components/Tutorial/useTutorial';
|
||||||
|
import { TUTORIAL_KEYS } from '../../components/Tutorial/tutorialSteps';
|
||||||
|
import TutorialOverlay from '../../components/Tutorial/TutorialOverlay';
|
||||||
|
|
||||||
interface CompletionContentProps {
|
interface CompletionContentProps {
|
||||||
onBack: () => void;
|
onBack: () => void;
|
||||||
songTaskId: string | null;
|
songTaskId: string | null;
|
||||||
onVideoStatusChange?: (status: 'idle' | 'generating' | 'complete' | 'error') => void;
|
onVideoStatusChange?: (status: 'idle' | 'generating' | 'complete' | 'error') => void;
|
||||||
onVideoProgressChange?: (progress: number) => void;
|
onVideoProgressChange?: (progress: number) => void;
|
||||||
|
onGoToCalendar?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
type VideoStatus = 'idle' | 'generating' | 'polling' | 'complete' | 'error';
|
type VideoStatus = 'idle' | 'generating' | 'polling' | 'complete' | 'error';
|
||||||
@@ -29,7 +33,8 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
|||||||
onBack,
|
onBack,
|
||||||
songTaskId,
|
songTaskId,
|
||||||
onVideoStatusChange,
|
onVideoStatusChange,
|
||||||
onVideoProgressChange
|
onVideoProgressChange,
|
||||||
|
onGoToCalendar,
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [videoStatus, setVideoStatus] = useState<VideoStatus>('idle');
|
const [videoStatus, setVideoStatus] = useState<VideoStatus>('idle');
|
||||||
@@ -37,7 +42,25 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
|||||||
const [errorMessage, setErrorMessage] = useState<string | null>(null);
|
const [errorMessage, setErrorMessage] = useState<string | null>(null);
|
||||||
const [statusMessage, setStatusMessage] = useState('');
|
const [statusMessage, setStatusMessage] = useState('');
|
||||||
const [renderProgress, setRenderProgress] = useState(0);
|
const [renderProgress, setRenderProgress] = useState(0);
|
||||||
|
const [displayProgress, setDisplayProgress] = useState(0);
|
||||||
const hasStartedGeneration = useRef(false);
|
const hasStartedGeneration = useRef(false);
|
||||||
|
const displayIntervalRef = useRef<ReturnType<typeof setInterval> | null>(null);
|
||||||
|
|
||||||
|
const tutorial = useTutorial();
|
||||||
|
const tutorialIsActiveRef = useRef(tutorial.isActive);
|
||||||
|
tutorialIsActiveRef.current = tutorial.isActive;
|
||||||
|
|
||||||
|
// 영상 생성 중 튜토리얼 트리거 (생성 상태 안내 -> 콘텐츠 정보 -> 내 정보 이동)
|
||||||
|
useEffect(() => {
|
||||||
|
const isComplete = videoStatus === 'complete';
|
||||||
|
const isProcessing = videoStatus === 'generating' || videoStatus === 'polling';
|
||||||
|
|
||||||
|
if (isProcessing && !tutorialIsActiveRef.current && !tutorial.hasSeen(TUTORIAL_KEYS.GENERATING)) {
|
||||||
|
tutorial.startTutorial(TUTORIAL_KEYS.GENERATING);
|
||||||
|
} else if (isComplete && !tutorialIsActiveRef.current && !tutorial.hasSeen(TUTORIAL_KEYS.COMPLETION)) {
|
||||||
|
tutorial.startTutorial(TUTORIAL_KEYS.COMPLETION);
|
||||||
|
}
|
||||||
|
}, [videoStatus]);
|
||||||
|
|
||||||
// 소셜 미디어 포스팅 모달
|
// 소셜 미디어 포스팅 모달
|
||||||
const [showSocialModal, setShowSocialModal] = useState(false);
|
const [showSocialModal, setShowSocialModal] = useState(false);
|
||||||
@@ -66,6 +89,31 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
|||||||
}
|
}
|
||||||
}, [renderProgress, onVideoProgressChange]);
|
}, [renderProgress, onVideoProgressChange]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (displayIntervalRef.current) clearInterval(displayIntervalRef.current);
|
||||||
|
|
||||||
|
if (renderProgress === 100) {
|
||||||
|
setDisplayProgress(100);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// renderProgress에 도달한 후에도 99%까지 서서히 크리핑
|
||||||
|
const CREEP_MAX = 99;
|
||||||
|
|
||||||
|
displayIntervalRef.current = setInterval(() => {
|
||||||
|
setDisplayProgress(prev => {
|
||||||
|
const target = Math.max(prev, renderProgress);
|
||||||
|
if (prev >= CREEP_MAX) return prev;
|
||||||
|
const increment = prev < 70 ? 0.2 : prev < 90 ? 0.04 : 0.01;
|
||||||
|
return Math.min(prev + increment, Math.max(target, Math.min(prev + increment, CREEP_MAX)));
|
||||||
|
});
|
||||||
|
}, 100);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
if (displayIntervalRef.current) clearInterval(displayIntervalRef.current);
|
||||||
|
};
|
||||||
|
}, [renderProgress]);
|
||||||
|
|
||||||
const saveToStorage = (videoTaskId: string, currentSongTaskId: string, status: VideoStatus, url: string | null, dbId?: number) => {
|
const saveToStorage = (videoTaskId: string, currentSongTaskId: string, status: VideoStatus, url: string | null, dbId?: number) => {
|
||||||
const data: SavedVideoState = {
|
const data: SavedVideoState = {
|
||||||
videoTaskId,
|
videoTaskId,
|
||||||
@@ -126,10 +174,19 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
|||||||
|
|
||||||
hasStartedGeneration.current = true;
|
hasStartedGeneration.current = true;
|
||||||
setVideoStatus('generating');
|
setVideoStatus('generating');
|
||||||
setStatusMessage(t('completion.requestingGeneration'));
|
setStatusMessage(t('completion.checkingSubtitle'));
|
||||||
setErrorMessage(null);
|
setErrorMessage(null);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// 자막 완료 여부 확인 후 미완료면 폴링
|
||||||
|
const subtitleStatus = await getSubtitleStatus(songTaskId);
|
||||||
|
if (subtitleStatus.status !== 'completed') {
|
||||||
|
setStatusMessage(t('completion.waitingSubtitle'));
|
||||||
|
await waitForSubtitleComplete(songTaskId);
|
||||||
|
}
|
||||||
|
|
||||||
|
setStatusMessage(t('completion.requestingGeneration'));
|
||||||
|
|
||||||
const savedRatio = localStorage.getItem('castad_video_ratio');
|
const savedRatio = localStorage.getItem('castad_video_ratio');
|
||||||
const orientation = (savedRatio === 'horizontal' || savedRatio === 'vertical') ? savedRatio : 'vertical';
|
const orientation = (savedRatio === 'horizontal' || savedRatio === 'vertical') ? savedRatio : 'vertical';
|
||||||
|
|
||||||
@@ -237,6 +294,7 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
|||||||
setVideoUrl(completeVideo.videoUrl);
|
setVideoUrl(completeVideo.videoUrl);
|
||||||
if (completeVideo.videoDbId) setVideoDbId(completeVideo.videoDbId);
|
if (completeVideo.videoDbId) setVideoDbId(completeVideo.videoDbId);
|
||||||
setVideoStatus('complete');
|
setVideoStatus('complete');
|
||||||
|
setShowComplete(true);
|
||||||
hasStartedGeneration.current = true;
|
hasStartedGeneration.current = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -248,6 +306,7 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
|||||||
setVideoUrl(savedState.videoUrl);
|
setVideoUrl(savedState.videoUrl);
|
||||||
if (savedState.videoDbId) setVideoDbId(savedState.videoDbId);
|
if (savedState.videoDbId) setVideoDbId(savedState.videoDbId);
|
||||||
setVideoStatus('complete');
|
setVideoStatus('complete');
|
||||||
|
setShowComplete(true);
|
||||||
hasStartedGeneration.current = true;
|
hasStartedGeneration.current = true;
|
||||||
} else if (savedState.status === 'polling') {
|
} else if (savedState.status === 'polling') {
|
||||||
setVideoStatus('polling');
|
setVideoStatus('polling');
|
||||||
@@ -279,15 +338,32 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
|||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleDownload = () => {
|
const [isDownloading, setIsDownloading] = useState(false);
|
||||||
if (videoUrl) {
|
|
||||||
|
const handleDownload = async () => {
|
||||||
|
if (!videoUrl || isDownloading) return;
|
||||||
|
setIsDownloading(true);
|
||||||
|
try {
|
||||||
|
const response = await fetch(videoUrl);
|
||||||
|
const blob = await response.blob();
|
||||||
|
const blobUrl = URL.createObjectURL(blob);
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = blobUrl;
|
||||||
|
link.download = getFileName();
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
document.body.removeChild(link);
|
||||||
|
URL.revokeObjectURL(blobUrl);
|
||||||
|
} catch {
|
||||||
const link = document.createElement('a');
|
const link = document.createElement('a');
|
||||||
link.href = videoUrl;
|
link.href = videoUrl;
|
||||||
link.download = 'castad_video.mp4';
|
link.download = getFileName();
|
||||||
link.target = '_blank';
|
link.target = '_blank';
|
||||||
document.body.appendChild(link);
|
document.body.appendChild(link);
|
||||||
link.click();
|
link.click();
|
||||||
document.body.removeChild(link);
|
document.body.removeChild(link);
|
||||||
|
} finally {
|
||||||
|
setIsDownloading(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -304,11 +380,20 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
|||||||
setVideoStatus('idle');
|
setVideoStatus('idle');
|
||||||
setVideoUrl(null);
|
setVideoUrl(null);
|
||||||
setErrorMessage(null);
|
setErrorMessage(null);
|
||||||
|
setShowComplete(false);
|
||||||
clearStorage();
|
clearStorage();
|
||||||
startVideoGeneration();
|
startVideoGeneration();
|
||||||
};
|
};
|
||||||
|
|
||||||
const isLoading = videoStatus === 'generating' || videoStatus === 'polling';
|
const [showComplete, setShowComplete] = useState(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (displayProgress < 100) return;
|
||||||
|
const timer = setTimeout(() => setShowComplete(true), 500);
|
||||||
|
return () => clearTimeout(timer);
|
||||||
|
}, [displayProgress]);
|
||||||
|
|
||||||
|
const isLoading = videoStatus === 'generating' || videoStatus === 'polling' || (videoStatus === 'complete' && !showComplete);
|
||||||
|
|
||||||
// 비디오 해상도 계산
|
// 비디오 해상도 계산
|
||||||
const getVideoResolution = () => {
|
const getVideoResolution = () => {
|
||||||
@@ -334,8 +419,8 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="comp2-title-row">
|
<div className="comp2-title-row">
|
||||||
<h1 className="comp2-page-title">{t('completion.contentComplete', { defaultValue: '콘텐츠 제작 완료' })}</h1>
|
<h1 className="comp2-page-title">{t('completion.contentComplete')}</h1>
|
||||||
<p className="comp2-page-subtitle">{t('completion.contentCompleteDesc', { defaultValue: 'AI 분석 및 편집을 통해 최적화된 콘텐츠가 완성되었습니다' })}</p>
|
<p className="comp2-page-subtitle">{t('completion.contentCompleteDesc')}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="comp2-container">
|
<div className="comp2-container">
|
||||||
@@ -352,6 +437,15 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p className="comp2-loading-text">{statusMessage}</p>
|
<p className="comp2-loading-text">{statusMessage}</p>
|
||||||
|
<div className="loading-progress-wrapper">
|
||||||
|
<div className="loading-progress-bar">
|
||||||
|
<div
|
||||||
|
className="loading-progress-fill"
|
||||||
|
style={{ width: `${displayProgress}%` }}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<span className="loading-progress-text">{Math.floor(displayProgress)}%</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : videoStatus === 'error' ? (
|
) : videoStatus === 'error' ? (
|
||||||
<div className="comp2-video-error">
|
<div className="comp2-video-error">
|
||||||
@@ -380,27 +474,51 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
|||||||
{/* 오른쪽: 콘텐츠 정보 */}
|
{/* 오른쪽: 콘텐츠 정보 */}
|
||||||
<div className="comp2-info-section">
|
<div className="comp2-info-section">
|
||||||
<div className="comp2-info-header">
|
<div className="comp2-info-header">
|
||||||
<span className="comp2-info-label">{t('completion.contentInfo', { defaultValue: '콘텐츠 정보' })}</span>
|
<span className="comp2-info-label">{t('completion.contentInfo')}</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="comp2-info-content">
|
<div className="comp2-info-content">
|
||||||
<div className="comp2-file-info">
|
<div className="comp2-file-info">
|
||||||
<h3 className="comp2-filename">{getFileName()}</h3>
|
<h3 className="comp2-filename">{getFileName()}</h3>
|
||||||
<p className="comp2-filesize">19.6MB</p>
|
{/* <p className="comp2-filesize">19.6MB</p> */}
|
||||||
</div>
|
</div>
|
||||||
<div className="comp2-meta-grid">
|
<div className="comp2-meta-grid">
|
||||||
<div className="comp2-meta-item">
|
<div className="comp2-meta-item">
|
||||||
<span className="comp2-meta-label">{t('completion.genre', { defaultValue: '장르' })} : {songCompletionData?.genre || 'K-POP'}</span>
|
<span className="comp2-meta-label">{t('completion.genre')} : {songCompletionData?.genre || 'K-POP'}</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="comp2-meta-divider"></div>
|
<div className="comp2-meta-divider"></div>
|
||||||
<div className="comp2-meta-item">
|
<div className="comp2-meta-item">
|
||||||
<span className="comp2-meta-label">{t('completion.resolution', { defaultValue: '규격' })} : {getVideoResolution()}</span>
|
<span className="comp2-meta-label">{t('completion.resolution')} : {getVideoResolution()}</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="comp2-meta-divider"></div>
|
<div className="comp2-meta-divider"></div>
|
||||||
<div className="comp2-lyrics-section">
|
<div className="comp2-lyrics-section">
|
||||||
<span className="comp2-meta-label">{t('completion.lyrics', { defaultValue: '가사' })}</span>
|
<span className="comp2-meta-label">{t('completion.lyrics')}</span>
|
||||||
<p className="comp2-lyrics-text">
|
{(() => {
|
||||||
{songCompletionData?.lyrics || t('completion.sampleLyrics', { defaultValue: '가사를 불러오는 중...' })}
|
if (!songCompletionData) {
|
||||||
</p>
|
return <p className="comp2-lyrics-text">{t('completion.sampleLyrics')}</p>;
|
||||||
|
}
|
||||||
|
if (!songCompletionData.lyrics) {
|
||||||
|
return <p className="comp2-lyrics-text">{t('completion.noLyricsBGM')}</p>;
|
||||||
|
}
|
||||||
|
const lines = songCompletionData.lyrics.split('\n').filter((l: string) => l.trim());
|
||||||
|
const outro = lines.slice(-1);
|
||||||
|
const body = lines.slice(0, -1);
|
||||||
|
const half = Math.ceil(body.length / 2);
|
||||||
|
const sections = [
|
||||||
|
{ tag: '[Verse]', lines: body.slice(0, half) },
|
||||||
|
{ tag: '[Chorus]', lines: body.slice(half) },
|
||||||
|
{ tag: '[Outro]', lines: outro },
|
||||||
|
].filter(s => s.lines.length > 0);
|
||||||
|
return (
|
||||||
|
<div className="comp2-lyrics-paragraphs">
|
||||||
|
{sections.map((section, i) => (
|
||||||
|
<div key={i} className="comp2-lyrics-para-section">
|
||||||
|
<span className="comp2-lyrics-tag">{section.tag}</span>
|
||||||
|
<p className="comp2-lyrics-text">{section.lines.join('\n')}</p>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})()}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -408,17 +526,17 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
|||||||
<div className="comp2-buttons">
|
<div className="comp2-buttons">
|
||||||
<button
|
<button
|
||||||
onClick={handleDownload}
|
onClick={handleDownload}
|
||||||
disabled={videoStatus !== 'complete' || !videoUrl}
|
disabled={videoStatus !== 'complete' || !videoUrl || isDownloading}
|
||||||
className="comp2-btn comp2-btn-secondary"
|
className="comp2-btn comp2-btn-secondary"
|
||||||
>
|
>
|
||||||
{t('completion.download', { defaultValue: '다운로드' })}
|
{isDownloading ? t('completion.downloading') : t('completion.download')}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={handleOpenSocialConnect}
|
onClick={handleOpenSocialConnect}
|
||||||
disabled={videoStatus !== 'complete' || !videoDbId}
|
disabled={videoStatus !== 'complete' || !videoDbId}
|
||||||
className="comp2-btn comp2-btn-primary"
|
className="comp2-btn comp2-btn-primary"
|
||||||
>
|
>
|
||||||
{t('completion.uploadToSocial', { defaultValue: '소셜 채널 업로드' })}
|
{t('completion.uploadToSocial')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -429,6 +547,7 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
|||||||
<SocialPostingModal
|
<SocialPostingModal
|
||||||
isOpen={showSocialModal}
|
isOpen={showSocialModal}
|
||||||
onClose={handleCloseSocialConnect}
|
onClose={handleCloseSocialConnect}
|
||||||
|
onGoToCalendar={onGoToCalendar}
|
||||||
video={videoUrl && videoDbId ? {
|
video={videoUrl && videoDbId ? {
|
||||||
video_id: videoDbId,
|
video_id: videoDbId,
|
||||||
store_name: songCompletionData?.businessName || '',
|
store_name: songCompletionData?.businessName || '',
|
||||||
@@ -436,8 +555,21 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
|||||||
task_id: songTaskId || '',
|
task_id: songTaskId || '',
|
||||||
result_movie_url: videoUrl,
|
result_movie_url: videoUrl,
|
||||||
created_at: new Date().toISOString(),
|
created_at: new Date().toISOString(),
|
||||||
|
like_count: 0,
|
||||||
|
comment_count: 0,
|
||||||
} : null}
|
} : null}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{tutorial.isActive && (
|
||||||
|
<TutorialOverlay
|
||||||
|
hints={tutorial.hints}
|
||||||
|
currentIndex={tutorial.currentHintIndex}
|
||||||
|
onNext={tutorial.nextHint}
|
||||||
|
onPrev={tutorial.prevHint}
|
||||||
|
onSkip={tutorial.skipTutorial}
|
||||||
|
groupProgress={tutorial.groupProgress}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</main>
|
</main>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
import React, { useState, useEffect, useCallback, useRef } from 'react';
|
import React, { useState, useEffect, useCallback, useRef } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
import { UploadHistoryItem } from '../../types/api';
|
import { UploadHistoryItem } from '../../types/api';
|
||||||
import { getUploadHistory, cancelUpload, retryUpload } from '../../utils/api';
|
import { getUploadHistory, cancelUpload, retryUpload } from '../../utils/api';
|
||||||
|
|
||||||
@@ -53,13 +54,13 @@ const statusColor = (status: UploadStatus) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 상태 라벨
|
// 상태 라벨 (컴포넌트 내부에서 t()로 처리)
|
||||||
const statusLabel = (status: UploadStatus) => {
|
const statusLabelKey = (status: UploadStatus) => {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 'completed': return '완료';
|
case 'completed': return 'contentCalendar.status.completed';
|
||||||
case 'scheduled':
|
case 'scheduled':
|
||||||
case 'pending': return '예약';
|
case 'pending': return 'contentCalendar.status.scheduled';
|
||||||
case 'failed': return '실패';
|
case 'failed': return 'contentCalendar.status.failed';
|
||||||
default: return status;
|
default: return status;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -69,6 +70,7 @@ interface ContentCalendarContentProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavigate }) => {
|
const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavigate }) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
const [year, setYear] = useState(today.getFullYear());
|
const [year, setYear] = useState(today.getFullYear());
|
||||||
const [month, setMonth] = useState(today.getMonth());
|
const [month, setMonth] = useState(today.getMonth());
|
||||||
@@ -203,7 +205,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
|
|
||||||
// 취소
|
// 취소
|
||||||
const handleCancel = async (uploadId: number) => {
|
const handleCancel = async (uploadId: number) => {
|
||||||
if (!window.confirm('예약을 취소하시겠습니까?')) return;
|
if (!window.confirm(t('contentCalendar.cancelConfirm'))) return;
|
||||||
// 낙관적 업데이트: 먼저 UI에서 제거
|
// 낙관적 업데이트: 먼저 UI에서 제거
|
||||||
setAllItems(prev => prev.filter(i => i.upload_id !== uploadId));
|
setAllItems(prev => prev.filter(i => i.upload_id !== uploadId));
|
||||||
setPanelItems(prev => prev.filter(i => i.upload_id !== uploadId));
|
setPanelItems(prev => prev.filter(i => i.upload_id !== uploadId));
|
||||||
@@ -212,7 +214,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
} catch {
|
} catch {
|
||||||
// 실패 시 다시 불러오기
|
// 실패 시 다시 불러오기
|
||||||
refreshAll();
|
refreshAll();
|
||||||
alert('취소에 실패했습니다.');
|
alert(t('contentCalendar.cancelFailed'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -222,7 +224,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
await retryUpload(uploadId);
|
await retryUpload(uploadId);
|
||||||
refreshAll();
|
refreshAll();
|
||||||
} catch {
|
} catch {
|
||||||
alert('재시도에 실패했습니다.');
|
alert(t('contentCalendar.retryFailed'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -234,10 +236,11 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
return `${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}`;
|
return `${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 날짜 표시 (M월 D)
|
// 날짜 표시
|
||||||
const formatDateLabel = (key: string) => {
|
const formatDateLabel = (key: string) => {
|
||||||
const [, m, d] = key.split('-');
|
const [, m, d] = key.split('-');
|
||||||
return `${parseInt(m)}월 ${parseInt(d)}`;
|
const months = t('contentCalendar.months', { returnObjects: true }) as string[];
|
||||||
|
return t('contentCalendar.monthDay', { month: months[parseInt(m) - 1], day: parseInt(d) });
|
||||||
};
|
};
|
||||||
|
|
||||||
const buildCalendarDays = (): CalendarDay[] => {
|
const buildCalendarDays = (): CalendarDay[] => {
|
||||||
@@ -266,9 +269,15 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
};
|
};
|
||||||
|
|
||||||
const calendarDays = buildCalendarDays();
|
const calendarDays = buildCalendarDays();
|
||||||
const monthNames = ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'];
|
const monthNames = t('contentCalendar.months', { returnObjects: true }) as string[];
|
||||||
const dayLabels = ['일','월','화','수','목','금','토'];
|
const dayLabels = t('contentCalendar.days', { returnObjects: true }) as string[];
|
||||||
const tabs: TabType[] = ['전체','완료','예약','실패'];
|
const tabs: TabType[] = ['전체','완료','예약','실패'];
|
||||||
|
const tabLabels: Record<TabType, string> = {
|
||||||
|
'전체': t('contentCalendar.tabs.all'),
|
||||||
|
'완료': t('contentCalendar.tabs.completed'),
|
||||||
|
'예약': t('contentCalendar.tabs.scheduled'),
|
||||||
|
'실패': t('contentCalendar.tabs.failed'),
|
||||||
|
};
|
||||||
|
|
||||||
// ── 캘린더 그리드 ──────────────────────────────────────────────
|
// ── 캘린더 그리드 ──────────────────────────────────────────────
|
||||||
const renderCalendarGrid = () => {
|
const renderCalendarGrid = () => {
|
||||||
@@ -388,7 +397,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
|
||||||
<div style={{ width: 8, height: 8, borderRadius: '50%', backgroundColor: '#1ba64f', flexShrink: 0 }} />
|
<div style={{ width: 8, height: 8, borderRadius: '50%', backgroundColor: '#1ba64f', flexShrink: 0 }} />
|
||||||
<span style={{ fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 11, color: '#01191a', lineHeight: 1, whiteSpace: 'nowrap' }}>
|
<span style={{ fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 11, color: '#01191a', lineHeight: 1, whiteSpace: 'nowrap' }}>
|
||||||
완료 {summary.completed}
|
{t('contentCalendar.completedCount', { count: summary.completed })}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -396,7 +405,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
|
||||||
<div style={{ width: 8, height: 8, borderRadius: '50%', backgroundColor: '#2563eb', flexShrink: 0 }} />
|
<div style={{ width: 8, height: 8, borderRadius: '50%', backgroundColor: '#2563eb', flexShrink: 0 }} />
|
||||||
<span style={{ fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 11, color: '#01191a', lineHeight: 1, whiteSpace: 'nowrap' }}>
|
<span style={{ fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 11, color: '#01191a', lineHeight: 1, whiteSpace: 'nowrap' }}>
|
||||||
예약 {summary.scheduled}
|
{t('contentCalendar.scheduledCount', { count: summary.scheduled })}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -404,7 +413,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
|
||||||
<div style={{ width: 8, height: 8, borderRadius: '50%', backgroundColor: '#e15252', flexShrink: 0 }} />
|
<div style={{ width: 8, height: 8, borderRadius: '50%', backgroundColor: '#e15252', flexShrink: 0 }} />
|
||||||
<span style={{ fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 11, color: '#01191a', lineHeight: 1, whiteSpace: 'nowrap' }}>
|
<span style={{ fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 11, color: '#01191a', lineHeight: 1, whiteSpace: 'nowrap' }}>
|
||||||
실패 {summary.failed}
|
{t('contentCalendar.failedCount', { count: summary.failed })}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -432,7 +441,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
letterSpacing: '-0.096px', lineHeight: '22px', whiteSpace: 'nowrap',
|
letterSpacing: '-0.096px', lineHeight: '22px', whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{tab}
|
{tabLabels[tab]}
|
||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@@ -442,9 +451,9 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
const renderStats = () => (
|
const renderStats = () => (
|
||||||
<div style={{ display: 'flex', gap: 16, alignItems: 'center' }}>
|
<div style={{ display: 'flex', gap: 16, alignItems: 'center' }}>
|
||||||
{[
|
{[
|
||||||
{ label: '예약', value: totalStats.scheduled },
|
{ label: t('contentCalendar.tabs.scheduled'), value: totalStats.scheduled },
|
||||||
{ label: '완료', value: totalStats.completed },
|
{ label: t('contentCalendar.tabs.completed'), value: totalStats.completed },
|
||||||
{ label: '실패', value: totalStats.failed },
|
{ label: t('contentCalendar.tabs.failed'), value: totalStats.failed },
|
||||||
].map((item, idx) => (
|
].map((item, idx) => (
|
||||||
<React.Fragment key={item.label}>
|
<React.Fragment key={item.label}>
|
||||||
{idx > 0 && <div style={{ width: 0, height: 14, borderLeft: '1px solid #379599' }} />}
|
{idx > 0 && <div style={{ width: 0, height: 14, borderLeft: '1px solid #379599' }} />}
|
||||||
@@ -483,7 +492,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
color: '#e5f1f2', letterSpacing: '-0.096px', lineHeight: '22px',
|
color: '#e5f1f2', letterSpacing: '-0.096px', lineHeight: '22px',
|
||||||
margin: 0, whiteSpace: 'nowrap',
|
margin: 0, whiteSpace: 'nowrap',
|
||||||
}}>
|
}}>
|
||||||
{year}년 {monthNames[month]}
|
{t('contentCalendar.yearMonth', { year, month: monthNames[month] })}
|
||||||
</p>
|
</p>
|
||||||
<button
|
<button
|
||||||
onClick={handleNextMonth}
|
onClick={handleNextMonth}
|
||||||
@@ -529,7 +538,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 13,
|
fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 13,
|
||||||
color: statusColor(item.status as UploadStatus), lineHeight: 1,
|
color: statusColor(item.status as UploadStatus), lineHeight: 1,
|
||||||
}}>
|
}}>
|
||||||
{statusLabel(item.status as UploadStatus)}
|
{t(statusLabelKey(item.status as UploadStatus))}
|
||||||
</span>
|
</span>
|
||||||
<span style={{
|
<span style={{
|
||||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 400, fontSize: 13,
|
fontFamily: 'Pretendard, sans-serif', fontWeight: 400, fontSize: 13,
|
||||||
@@ -539,19 +548,28 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 채널 아이콘 + 제목 */}
|
{/* 채널 아이콘 + 채널명 */}
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
|
||||||
<PlatformIcon platform={item.platform} size={18} />
|
<PlatformIcon platform={item.platform} size={16} />
|
||||||
<span style={{
|
<span style={{
|
||||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 600, fontSize: 14,
|
fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 12,
|
||||||
color: '#e5f1f2', lineHeight: 1.4,
|
color: '#9bcacc', lineHeight: 1.4,
|
||||||
overflow: 'hidden', display: '-webkit-box',
|
overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis',
|
||||||
WebkitLineClamp: 2, WebkitBoxOrient: 'vertical',
|
|
||||||
}}>
|
}}>
|
||||||
{item.title}
|
{item.platform_username || item.platform_user_id || item.channel_name}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* 제목 */}
|
||||||
|
<span style={{
|
||||||
|
fontFamily: 'Pretendard, sans-serif', fontWeight: 600, fontSize: 14,
|
||||||
|
color: '#e5f1f2', lineHeight: 1.4,
|
||||||
|
overflow: 'hidden', display: '-webkit-box',
|
||||||
|
WebkitLineClamp: 2, WebkitBoxOrient: 'vertical',
|
||||||
|
}}>
|
||||||
|
{item.title}
|
||||||
|
</span>
|
||||||
|
|
||||||
{/* 실패 메시지 */}
|
{/* 실패 메시지 */}
|
||||||
{isFailed && item.error_message && (
|
{isFailed && item.error_message && (
|
||||||
<p style={{
|
<p style={{
|
||||||
@@ -575,7 +593,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
color: '#9bcacc', cursor: 'pointer',
|
color: '#9bcacc', cursor: 'pointer',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
취소
|
{t('contentCalendar.cancel')}
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
{isFailed && (
|
{isFailed && (
|
||||||
@@ -588,7 +606,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
color: '#ffffff', cursor: 'pointer',
|
color: '#ffffff', cursor: 'pointer',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
재시도
|
{t('contentCalendar.retry')}
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -602,7 +620,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
if (panelLoading) {
|
if (panelLoading) {
|
||||||
return (
|
return (
|
||||||
<div style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
<div style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
||||||
<span style={{ color: '#9bcacc', fontFamily: 'Pretendard, sans-serif', fontSize: 14 }}>불러오는 중...</span>
|
<span style={{ color: '#9bcacc', fontFamily: 'Pretendard, sans-serif', fontSize: 14 }}>{t('contentCalendar.loading')}</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -617,13 +635,13 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 700, fontSize: 16,
|
fontFamily: 'Pretendard, sans-serif', fontWeight: 700, fontSize: 16,
|
||||||
color: '#e5f1f2', letterSpacing: '-0.096px', lineHeight: '22px', margin: 0,
|
color: '#e5f1f2', letterSpacing: '-0.096px', lineHeight: '22px', margin: 0,
|
||||||
}}>
|
}}>
|
||||||
최근 결과 없음
|
{t('contentCalendar.noResults')}
|
||||||
</p>
|
</p>
|
||||||
<p style={{
|
<p style={{
|
||||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 12,
|
fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 12,
|
||||||
color: '#9bcacc', letterSpacing: '-0.072px', lineHeight: 1, margin: 0,
|
color: '#9bcacc', letterSpacing: '-0.072px', lineHeight: 1, margin: 0,
|
||||||
}}>
|
}}>
|
||||||
제작한 콘텐츠를 소셜 채널에 업로드해 보세요
|
{t('contentCalendar.noResultsDesc')}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
@@ -635,7 +653,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
color: '#ffffff',
|
color: '#ffffff',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
ADO2 콘텐츠
|
{t('contentCalendar.ado2Contents')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -644,7 +662,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
<div
|
<div
|
||||||
ref={panelRef}
|
ref={panelRef}
|
||||||
className="calendar-panel-scroll"
|
className="calendar-panel-scroll"
|
||||||
style={{ flex: 1, overflowY: 'auto', padding: '12px 16px', display: 'flex', flexDirection: 'column', gap: 20, maxHeight: 900 }}
|
style={{ flex: 1, overflowY: 'auto', padding: '12px 16px', display: 'flex', flexDirection: 'column', gap: 20, maxHeight: 700 }}
|
||||||
>
|
>
|
||||||
{sortedDateKeys.map(dateKey => (
|
{sortedDateKeys.map(dateKey => (
|
||||||
<div
|
<div
|
||||||
@@ -681,7 +699,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 700, fontSize: 30,
|
fontFamily: 'Pretendard, sans-serif', fontWeight: 700, fontSize: 30,
|
||||||
color: '#ffffff', letterSpacing: '-0.18px', lineHeight: 1.3, margin: 0,
|
color: '#ffffff', letterSpacing: '-0.18px', lineHeight: 1.3, margin: 0,
|
||||||
}}>
|
}}>
|
||||||
콘텐츠 캘린더
|
{t('contentCalendar.title')}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -736,7 +754,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
return (
|
return (
|
||||||
<div style={{
|
<div style={{
|
||||||
display: 'flex', flexDirection: 'column', alignItems: 'center',
|
display: 'flex', flexDirection: 'column', alignItems: 'center',
|
||||||
padding: '80px 32px',
|
padding: '32px',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
minWidth: 1400,
|
minWidth: 1400,
|
||||||
height: '100%', boxSizing: 'border-box',
|
height: '100%', boxSizing: 'border-box',
|
||||||
@@ -746,7 +764,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
fontFamily: 'Pretendard, sans-serif', fontWeight: 700, fontSize: 30,
|
fontFamily: 'Pretendard, sans-serif', fontWeight: 700, fontSize: 30,
|
||||||
color: '#ffffff', letterSpacing: '-0.18px', lineHeight: 1.3, margin: 0,
|
color: '#ffffff', letterSpacing: '-0.18px', lineHeight: 1.3, margin: 0,
|
||||||
}}>
|
}}>
|
||||||
콘텐츠 캘린더
|
{t('contentCalendar.title')}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -758,7 +776,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
flex: 1, minHeight: 0,
|
flex: 1, minHeight: 0,
|
||||||
}}>
|
}}>
|
||||||
{/* 캘린더 영역 */}
|
{/* 캘린더 영역 */}
|
||||||
<div style={{
|
<div className="calendar-grid-area" style={{
|
||||||
gridColumn: '1 / span 8',
|
gridColumn: '1 / span 8',
|
||||||
backgroundColor: '#01393b',
|
backgroundColor: '#01393b',
|
||||||
borderRadius: 20, padding: 16,
|
borderRadius: 20, padding: 16,
|
||||||
@@ -774,13 +792,13 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
|
|||||||
</div>
|
</div>
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<div style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
<div style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
||||||
<span style={{ color: '#9bcacc', fontFamily: 'Pretendard, sans-serif', fontSize: 14 }}>불러오는 중...</span>
|
<span style={{ color: '#9bcacc', fontFamily: 'Pretendard, sans-serif', fontSize: 14 }}>{t('contentCalendar.loading')}</span>
|
||||||
</div>
|
</div>
|
||||||
) : renderCalendarGrid()}
|
) : renderCalendarGrid()}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 오른쪽 패널 */}
|
{/* 오른쪽 패널 */}
|
||||||
<div style={{
|
<div className="calendar-side-panel" style={{
|
||||||
gridColumn: '9 / span 1',
|
gridColumn: '9 / span 1',
|
||||||
backgroundColor: '#01393b', borderRadius: 20,
|
backgroundColor: '#01393b', borderRadius: 20,
|
||||||
display: 'flex', flexDirection: 'column', overflow: 'hidden',
|
display: 'flex', flexDirection: 'column', overflow: 'hidden',
|
||||||
|
|||||||
@@ -81,29 +81,29 @@ interface ConnectedAccount {
|
|||||||
// =====================================================
|
// =====================================================
|
||||||
|
|
||||||
const MOCK_CONTENT_METRICS: ContentMetric[] = [
|
const MOCK_CONTENT_METRICS: ContentMetric[] = [
|
||||||
{ id: 'total-views', label: '조회수', value: 240000, unit: 'count', trend: 3800, trendDirection: 'up' },
|
{ id: 'total-views', label: 'dashboard.metricTotalViews', value: 240000, unit: 'count', trend: 3800, trendDirection: 'up' },
|
||||||
{ id: 'total-watch-time', label: '시청시간', value: 85.3, unit: 'hours', trend: 21.5, trendDirection: 'up' },
|
{ id: 'total-watch-time', label: 'dashboard.metricWatchTime', value: 85.3, unit: 'hours', trend: 21.5, trendDirection: 'up' },
|
||||||
{ id: 'avg-view-duration',label: '평균 시청시간', value: 41, unit: 'minutes', trend: 2.4, trendDirection: 'up' },
|
{ id: 'avg-view-duration',label: 'dashboard.metricAvgViewDuration', value: 41, unit: 'minutes', trend: 2.4, trendDirection: 'up' },
|
||||||
{ id: 'new-subscribers', label: '신규 구독자', value: 483, unit: 'count', trend: 50, trendDirection: 'up' },
|
{ id: 'new-subscribers', label: 'dashboard.metricNewSubscribers', value: 483, unit: 'count', trend: 50, trendDirection: 'up' },
|
||||||
{ id: 'likes', label: '좋아요', value: 15800, unit: 'count', trend: 180, trendDirection: 'up' },
|
{ id: 'likes', label: 'dashboard.metricLikes', value: 15800, unit: 'count', trend: 180, trendDirection: 'up' },
|
||||||
{ id: 'comments', label: '댓글', value: 2500, unit: 'count', trend: 50, trendDirection: 'down' },
|
{ id: 'comments', label: 'dashboard.metricComments', value: 2500, unit: 'count', trend: 50, trendDirection: 'down' },
|
||||||
{ id: 'shares', label: '공유', value: 840, unit: 'count', trend: 15, trendDirection: 'up' },
|
{ id: 'shares', label: 'dashboard.metricShares', value: 840, unit: 'count', trend: 15, trendDirection: 'up' },
|
||||||
{ id: 'uploaded-videos', label: '업로드 영상', value: 17, unit: 'count', trend: 4, trendDirection: 'up' },
|
{ id: 'uploaded-videos', label: 'dashboard.metricUploadedVideos', value: 17, unit: 'count', trend: 4, trendDirection: 'up' },
|
||||||
];
|
];
|
||||||
|
|
||||||
const MOCK_MONTHLY_DATA: MonthlyData[] = [
|
const MOCK_MONTHLY_DATA: MonthlyData[] = [
|
||||||
{ month: '1월', thisYear: 18000, lastYear: 14500 },
|
{ month: 'dashboard.months.jan', thisYear: 18000, lastYear: 14500 },
|
||||||
{ month: '2월', thisYear: 19500, lastYear: 15800 },
|
{ month: 'dashboard.months.feb', thisYear: 19500, lastYear: 15800 },
|
||||||
{ month: '3월', thisYear: 21000, lastYear: 17200 },
|
{ month: 'dashboard.months.mar', thisYear: 21000, lastYear: 17200 },
|
||||||
{ month: '4월', thisYear: 18500, lastYear: 16800 },
|
{ month: 'dashboard.months.apr', thisYear: 18500, lastYear: 16800 },
|
||||||
{ month: '5월', thisYear: 24000, lastYear: 19500 },
|
{ month: 'dashboard.months.may', thisYear: 24000, lastYear: 19500 },
|
||||||
{ month: '6월', thisYear: 27500, lastYear: 21000 },
|
{ month: 'dashboard.months.jun', thisYear: 27500, lastYear: 21000 },
|
||||||
{ month: '7월', thisYear: 32000, lastYear: 23500 },
|
{ month: 'dashboard.months.jul', thisYear: 32000, lastYear: 23500 },
|
||||||
{ month: '8월', thisYear: 29500, lastYear: 24800 },
|
{ month: 'dashboard.months.aug', thisYear: 29500, lastYear: 24800 },
|
||||||
{ month: '9월', thisYear: 31000, lastYear: 26200 },
|
{ month: 'dashboard.months.sep', thisYear: 31000, lastYear: 26200 },
|
||||||
{ month: '10월', thisYear: 28500, lastYear: 25500 },
|
{ month: 'dashboard.months.oct', thisYear: 28500, lastYear: 25500 },
|
||||||
{ month: '11월', thisYear: 34000, lastYear: 27800 },
|
{ month: 'dashboard.months.nov', thisYear: 34000, lastYear: 27800 },
|
||||||
{ month: '12월', thisYear: 38000, lastYear: 29500 },
|
{ month: 'dashboard.months.dec', thisYear: 38000, lastYear: 29500 },
|
||||||
];
|
];
|
||||||
|
|
||||||
const MOCK_DAILY_DATA: DailyData[] = Array.from({ length: 30 }, (_, i) => {
|
const MOCK_DAILY_DATA: DailyData[] = Array.from({ length: 30 }, (_, i) => {
|
||||||
@@ -201,18 +201,16 @@ const formatNumber = (num: number): string => {
|
|||||||
return num.toString();
|
return num.toString();
|
||||||
};
|
};
|
||||||
|
|
||||||
// unit에 따라 value를 표시용 문자열로 변환 (언어별 suffix는 호출부에서 처리)
|
const formatValue = (value: number, unit: string, unitHours: string, unitMinutes: string): string => {
|
||||||
const formatValue = (value: number, unit: string): string => {
|
if (unit === 'hours') return value.toFixed(1) + unitHours;
|
||||||
if (unit === 'hours') return value.toFixed(1) + '시간';
|
if (unit === 'minutes') return Math.round(value) + unitMinutes;
|
||||||
if (unit === 'minutes') return Math.round(value) + '분';
|
|
||||||
return formatNumber(Math.round(value));
|
return formatNumber(Math.round(value));
|
||||||
};
|
};
|
||||||
|
|
||||||
// unit에 따라 trend 절댓값을 표시용 문자열로 변환
|
const formatTrend = (trend: number, unit: string, unitHours: string, unitMinutes: string): string => {
|
||||||
const formatTrend = (trend: number, unit: string): string => {
|
|
||||||
const abs = Math.abs(trend);
|
const abs = Math.abs(trend);
|
||||||
if (unit === 'hours') return abs.toFixed(1) + '시간';
|
if (unit === 'hours') return abs.toFixed(1) + unitHours;
|
||||||
if (unit === 'minutes') return Math.round(abs) + '분';
|
if (unit === 'minutes') return Math.round(abs) + unitMinutes;
|
||||||
return formatNumber(Math.round(abs));
|
return formatNumber(Math.round(abs));
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -239,19 +237,22 @@ const TrendIcon: React.FC<{ direction: 'up' | 'down' }> = ({ direction }) => (
|
|||||||
);
|
);
|
||||||
|
|
||||||
const StatCard: React.FC<ContentMetric> = ({ label, value, unit, trend, trendDirection }) => {
|
const StatCard: React.FC<ContentMetric> = ({ label, value, unit, trend, trendDirection }) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const unitHours = t('dashboard.unitHours');
|
||||||
|
const unitMinutes = t('dashboard.unitMinutes');
|
||||||
const isNeutral = trend === 0 || trendDirection === '-';
|
const isNeutral = trend === 0 || trendDirection === '-';
|
||||||
const isUp = trendDirection === 'up';
|
const isUp = trendDirection === 'up';
|
||||||
return (
|
return (
|
||||||
<div className="stat-card">
|
<div className="stat-card">
|
||||||
<span className="stat-label">{label}</span>
|
<span className="stat-label">{t(label)}</span>
|
||||||
<h3 className="stat-value">{formatValue(value, unit)}</h3>
|
<h3 className="stat-value">{formatValue(value, unit, unitHours, unitMinutes)}</h3>
|
||||||
<div className="stat-trend-wrapper">
|
<div className="stat-trend-wrapper">
|
||||||
{isNeutral ? (
|
{isNeutral ? (
|
||||||
<span className="stat-trend neutral">─</span>
|
<span className="stat-trend neutral">─</span>
|
||||||
) : (
|
) : (
|
||||||
<span className={`stat-trend ${isUp ? 'up' : 'down'}`}>
|
<span className={`stat-trend ${isUp ? 'up' : 'down'}`}>
|
||||||
<TrendIcon direction={isUp ? 'up' : 'down'} />
|
<TrendIcon direction={isUp ? 'up' : 'down'} />
|
||||||
{isUp ? '+' : '-'}{formatTrend(trend, unit)}
|
{isUp ? '+' : '-'}{formatTrend(trend, unit, unitHours, unitMinutes)}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -276,11 +277,12 @@ const YearOverYearChart: React.FC<{
|
|||||||
currentLabel: string;
|
currentLabel: string;
|
||||||
previousLabel: string;
|
previousLabel: string;
|
||||||
mode: 'day' | 'month';
|
mode: 'day' | 'month';
|
||||||
}> = ({ data, currentLabel, previousLabel, mode }) => {
|
noDataLabel: string;
|
||||||
|
}> = ({ data, currentLabel, previousLabel, mode, noDataLabel }) => {
|
||||||
if (data.length === 0) {
|
if (data.length === 0) {
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', height: '200px', opacity: 0.4 }}>
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', height: '200px', opacity: 0.4 }}>
|
||||||
<span>이 기간에 데이터가 없습니다.</span>
|
<span>{noDataLabel}</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -362,14 +364,14 @@ const YearOverYearChart: React.FC<{
|
|||||||
// Icon Components
|
// Icon Components
|
||||||
// =====================================================
|
// =====================================================
|
||||||
|
|
||||||
const YouTubeIcon: React.FC<{ className?: string }> = ({ className }) => (
|
const YouTubeIcon: React.FC<{ className?: string; style?: React.CSSProperties }> = ({ className, style }) => (
|
||||||
<svg className={className || "platform-tab-icon"} viewBox="0 0 24 24" fill="currentColor">
|
<svg className={className || "platform-tab-icon"} style={style} viewBox="0 0 24 24" fill="currentColor">
|
||||||
<path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z" />
|
<path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z" />
|
||||||
</svg>
|
</svg>
|
||||||
);
|
);
|
||||||
|
|
||||||
const InstagramIcon: React.FC<{ className?: string }> = ({ className }) => (
|
const InstagramIcon: React.FC<{ className?: string; style?: React.CSSProperties }> = ({ className, style }) => (
|
||||||
<svg className={className || "platform-tab-icon"} viewBox="0 0 24 24" fill="currentColor">
|
<svg className={className || "platform-tab-icon"} style={style} viewBox="0 0 24 24" fill="currentColor">
|
||||||
<path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 1 0 0 12.324 6.162 6.162 0 0 0 0-12.324zM12 16a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm6.406-11.845a1.44 1.44 0 1 0 0 2.881 1.44 1.44 0 0 0 0-2.881z" />
|
<path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 1 0 0 12.324 6.162 6.162 0 0 0 0-12.324zM12 16a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm6.406-11.845a1.44 1.44 0 1 0 0 2.881 1.44 1.44 0 0 0 0-2.881z" />
|
||||||
</svg>
|
</svg>
|
||||||
);
|
);
|
||||||
@@ -480,6 +482,7 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
|||||||
const [isLoading, setIsLoading] = useState(true);
|
const [isLoading, setIsLoading] = useState(true);
|
||||||
const [error, setError] = useState<DashboardError | null>(null);
|
const [error, setError] = useState<DashboardError | null>(null);
|
||||||
const [showMockData, setShowMockData] = useState(false);
|
const [showMockData, setShowMockData] = useState(false);
|
||||||
|
const [retryTrigger, setRetryTrigger] = useState(0);
|
||||||
|
|
||||||
// 계정 관련 state
|
// 계정 관련 state
|
||||||
const [accounts, setAccounts] = useState<ConnectedAccount[]>([]);
|
const [accounts, setAccounts] = useState<ConnectedAccount[]>([]);
|
||||||
@@ -571,7 +574,13 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
|||||||
setDashboardData(null);
|
setDashboardData(null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
throw new Error(errorData.detail || `API Error: ${response.status}`);
|
if (errorData.code === 'YOUTUBE_API_FAILED') {
|
||||||
|
setError({ code: 'YOUTUBE_API_FAILED', message: t('dashboard.youtubeApiFailed') });
|
||||||
|
setDashboardData(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setError({ code: errorData.code || 'API_ERROR', message: errorData.detail || `API Error: ${response.status}`, reconnect_url: errorData.reconnect_url });
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const data: DashboardResponse = await response.json();
|
const data: DashboardResponse = await response.json();
|
||||||
@@ -586,7 +595,7 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
|||||||
setError(null);
|
setError(null);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Dashboard API Error:', err);
|
console.error('Dashboard API Error:', err);
|
||||||
setError(err instanceof Error ? err.message : 'Unknown error');
|
setError({ code: 'UNKNOWN', message: err instanceof Error ? err.message : 'Unknown error' });
|
||||||
setDashboardData(null);
|
setDashboardData(null);
|
||||||
} finally {
|
} finally {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
@@ -594,12 +603,12 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
fetchDashboardData();
|
fetchDashboardData();
|
||||||
}, [mode, selectedAccountId, accountsLoaded]);
|
}, [mode, selectedAccountId, accountsLoaded, retryTrigger]);
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return (
|
return (
|
||||||
<div className="flex justify-center items-center h-screen">
|
<div className="flex justify-center items-center h-screen">
|
||||||
<div className="text-lg">{t('데이터 로딩 중...')}</div>
|
<div className="text-lg">{t('dashboard.dataLoading')}</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -607,31 +616,33 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
|||||||
// hasUploads === false이고 error 없음: 업로드 영상 없음 → 전체 mock 데이터 표시 + 안내 배너
|
// hasUploads === false이고 error 없음: 업로드 영상 없음 → 전체 mock 데이터 표시 + 안내 배너
|
||||||
const isEmptyState = dashboardData?.hasUploads === false && !dashboardData?.error;
|
const isEmptyState = dashboardData?.hasUploads === false && !dashboardData?.error;
|
||||||
|
|
||||||
// 블러 조건: 1)계정 미연결 2)업로드 영상 없음 3)데이터 없음 4)에러 있음
|
// showMockData=true면 전체 mock 강제, 아니면 API 우선 / isEmptyState 시 mock 폴백
|
||||||
const isBlurred = accounts.length === 0 || isEmptyState || !dashboardData || !!error;
|
const useReal = !showMockData && !isEmptyState;
|
||||||
|
const hasRealContentMetrics = useReal && !!dashboardData?.contentMetrics?.some((m: ContentMetric) => m.value > 0);
|
||||||
|
const contentMetrics = hasRealContentMetrics ? dashboardData!.contentMetrics : MOCK_CONTENT_METRICS;
|
||||||
|
|
||||||
// API 데이터 우선 사용, 없거나 영상 없음(isEmptyState) 시 Mock 데이터로 폴백
|
// 블러 조건: 1)계정 미연결 2)업로드 영상 없음 3)데이터 없음 4)에러 있음 5)실제 지표 없음
|
||||||
const contentMetrics = (!isEmptyState && dashboardData?.contentMetrics?.length) ? dashboardData.contentMetrics : MOCK_CONTENT_METRICS;
|
const isBlurred = accounts.length === 0 || isEmptyState || !dashboardData || !!error || !hasRealContentMetrics;
|
||||||
const topContent = (!isEmptyState && dashboardData?.topContent?.length) ? dashboardData.topContent : MOCK_TOP_CONTENT;
|
const topContent = (useReal && dashboardData?.topContent?.length) ? dashboardData.topContent : MOCK_TOP_CONTENT;
|
||||||
const hasRealAgeGroups = !isEmptyState && !!dashboardData?.audienceData?.ageGroups?.some(g => g.percentage > 0);
|
const hasRealAgeGroups = useReal && !!dashboardData?.audienceData?.ageGroups?.some(g => g.percentage > 0);
|
||||||
const hasRealGender = !isEmptyState && ((dashboardData?.audienceData?.gender?.male ?? 0) + (dashboardData?.audienceData?.gender?.female ?? 0)) > 0;
|
const hasRealGender = useReal && ((dashboardData?.audienceData?.gender?.male ?? 0) + (dashboardData?.audienceData?.gender?.female ?? 0)) > 0;
|
||||||
const hasRealTopRegions = !isEmptyState && !!dashboardData?.audienceData?.topRegions?.some(r => r.percentage > 0);
|
const hasRealTopRegions = useReal && !!dashboardData?.audienceData?.topRegions?.some(r => r.percentage > 0);
|
||||||
const hasRealAudienceData = hasRealAgeGroups && hasRealGender && hasRealTopRegions;
|
const hasRealAudienceData = hasRealAgeGroups && hasRealGender && hasRealTopRegions;
|
||||||
const audienceData = hasRealAudienceData ? dashboardData!.audienceData : MOCK_AUDIENCE_DATA;
|
const audienceData = hasRealAudienceData ? dashboardData!.audienceData : MOCK_AUDIENCE_DATA;
|
||||||
|
|
||||||
// mode별 차트 데이터를 ChartDataPoint 통합 형식으로 변환
|
// mode별 차트 데이터를 ChartDataPoint 통합 형식으로 변환
|
||||||
const chartData: ChartDataPoint[] = mode === 'month'
|
const chartData: ChartDataPoint[] = mode === 'month'
|
||||||
? ((!isEmptyState && dashboardData?.monthlyData?.length)
|
? ((useReal && dashboardData?.monthlyData?.length)
|
||||||
? dashboardData.monthlyData.map((d: MonthlyData) => ({ label: d.month, current: d.thisYear, previous: d.lastYear }))
|
? dashboardData.monthlyData.map((d: MonthlyData) => ({ label: d.month, current: d.thisYear, previous: d.lastYear }))
|
||||||
: MOCK_MONTHLY_DATA.map((d: MonthlyData) => ({ label: d.month, current: d.thisYear, previous: d.lastYear })))
|
: MOCK_MONTHLY_DATA.map((d: MonthlyData) => ({ label: t(d.month), current: d.thisYear, previous: d.lastYear })))
|
||||||
: ((!isEmptyState && dashboardData?.dailyData?.length)
|
: ((useReal && dashboardData?.dailyData?.length)
|
||||||
? dashboardData.dailyData.map((d: DailyData) => ({ label: d.date, current: d.thisPeriod, previous: d.lastPeriod }))
|
? dashboardData.dailyData.map((d: DailyData) => ({ label: d.date, current: d.thisPeriod, previous: d.lastPeriod }))
|
||||||
: MOCK_DAILY_DATA.map((d: DailyData) => ({ label: d.date, current: d.thisPeriod, previous: d.lastPeriod })));
|
: MOCK_DAILY_DATA.map((d: DailyData) => ({ label: d.date, current: d.thisPeriod, previous: d.lastPeriod })));
|
||||||
|
|
||||||
// mode별 차트 레이블
|
// mode별 차트 레이블
|
||||||
const chartCurrentLabel = mode === 'month' ? '올해' : '이번달';
|
const chartCurrentLabel = mode === 'month' ? t('dashboard.chartThisYear') : t('dashboard.chartThisMonth');
|
||||||
const chartPreviousLabel = mode === 'month' ? '작년' : '지난달';
|
const chartPreviousLabel = mode === 'month' ? t('dashboard.chartLastYear') : t('dashboard.chartLastMonth');
|
||||||
const chartSectionTitle = mode === 'month' ? t('dashboard.yearOverYear') : '전월 대비 성장';
|
const chartSectionTitle = mode === 'month' ? t('dashboard.yearOverYear') : t('dashboard.monthOverMonth');
|
||||||
|
|
||||||
const lastUpdated = new Date().toLocaleDateString('ko-KR', {
|
const lastUpdated = new Date().toLocaleDateString('ko-KR', {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
@@ -649,8 +660,24 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
|||||||
<path d="M15 10l4.553-2.069A1 1 0 0121 8.87v6.26a1 1 0 01-1.447.899L15 14M3 8a2 2 0 012-2h10a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2V8z" strokeLinecap="round" strokeLinejoin="round" />
|
<path d="M15 10l4.553-2.069A1 1 0 0121 8.87v6.26a1 1 0 01-1.447.899L15 14M3 8a2 2 0 012-2h10a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2V8z" strokeLinecap="round" strokeLinejoin="round" />
|
||||||
</svg>
|
</svg>
|
||||||
<div>
|
<div>
|
||||||
<p style={{ color: '#a6ffea', fontWeight: 600, marginBottom: '2px' }}>아직 업로드된 영상이 없습니다.</p>
|
<p style={{ color: '#a6ffea', fontSize: '20px', fontWeight: 600, marginBottom: '2px' }}>{t('dashboard.noUploadsTitle')}</p>
|
||||||
<p style={{ color: 'rgba(255,255,255,0.5)', fontSize: '13px' }}>ADO2에서 영상을 업로드하면 실제 통계가 표시됩니다.</p>
|
<p style={{ color: 'rgba(255,255,255,0.5)', fontSize: '16px' }}>{t('dashboard.noUploadsDesc')}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* 48시간 지연 안내 배너 */}
|
||||||
|
{dashboardData && !isEmptyState && !hasRealContentMetrics && !showMockData && (
|
||||||
|
<div className="mb-4 p-4 border-l-4 rounded" style={{ background: 'rgba(255,210,100,0.06)', borderColor: '#ffd264' }}>
|
||||||
|
<div className="flex items-center gap-3">
|
||||||
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#ffd264" strokeWidth="2" style={{ flexShrink: 0 }}>
|
||||||
|
<circle cx="12" cy="12" r="10" />
|
||||||
|
<path d="M12 6v6l4 2" strokeLinecap="round" strokeLinejoin="round" />
|
||||||
|
</svg>
|
||||||
|
<div>
|
||||||
|
<p style={{ color: '#ffd264', fontSize: '16px', fontWeight: 600, marginBottom: '2px' }}>{t('dashboard.dataDelayTitle')}</p>
|
||||||
|
<p style={{ color: 'rgba(255,255,255,0.5)', fontSize: '14px' }}>{t('dashboard.dataDelayDesc')}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -671,7 +698,7 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
|||||||
onClick={() => onNavigate?.('내 정보')}
|
onClick={() => onNavigate?.('내 정보')}
|
||||||
className="ml-4 px-4 py-2 bg-yellow-600 text-white rounded hover:bg-yellow-700 whitespace-nowrap"
|
className="ml-4 px-4 py-2 bg-yellow-600 text-white rounded hover:bg-yellow-700 whitespace-nowrap"
|
||||||
>
|
>
|
||||||
재연동하러 가기 →
|
{t('dashboard.reconnectButton')}
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
{error.code === 'YOUTUBE_NOT_CONNECTED' && (
|
{error.code === 'YOUTUBE_NOT_CONNECTED' && (
|
||||||
@@ -679,7 +706,15 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
|||||||
onClick={() => onNavigate?.('내 정보')}
|
onClick={() => onNavigate?.('내 정보')}
|
||||||
className="ml-4 px-4 py-2 bg-yellow-600 text-white rounded hover:bg-yellow-700 whitespace-nowrap"
|
className="ml-4 px-4 py-2 bg-yellow-600 text-white rounded hover:bg-yellow-700 whitespace-nowrap"
|
||||||
>
|
>
|
||||||
연동하러 가기 →
|
{t('dashboard.connectButton')}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
{(error.code === 'YOUTUBE_API_FAILED' || error.code === 'DASHBOARD_DATA_ERROR') && (
|
||||||
|
<button
|
||||||
|
onClick={() => { setError(null); setRetryTrigger((n: number) => n + 1); }}
|
||||||
|
className="ml-4 px-4 py-2 bg-yellow-600 text-white rounded hover:bg-yellow-700 whitespace-nowrap"
|
||||||
|
>
|
||||||
|
{t('dashboard.retryButton')}
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -722,7 +757,7 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
|||||||
</span>
|
</span>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<span style={{ flex: 1, color: 'rgba(255,255,255,0.4)' }}>계정을 선택하세요</span>
|
<span style={{ flex: 1, color: 'rgba(255,255,255,0.4)' }}>{t('dashboard.selectAccount')}</span>
|
||||||
);
|
);
|
||||||
})()}
|
})()}
|
||||||
<svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="rgba(255,255,255,0.5)" strokeWidth="2" style={{ flexShrink: 0, marginLeft: 'auto' }}>
|
<svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="rgba(255,255,255,0.5)" strokeWidth="2" style={{ flexShrink: 0, marginLeft: 'auto' }}>
|
||||||
@@ -784,20 +819,20 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
|||||||
<div className="flex items-center justify-between mb-4">
|
<div className="flex items-center justify-between mb-4">
|
||||||
<div>
|
<div>
|
||||||
<h2 className="dashboard-section-title" style={{ marginBottom: '2px' }}>{t('dashboard.contentPerformance')}</h2>
|
<h2 className="dashboard-section-title" style={{ marginBottom: '2px' }}>{t('dashboard.contentPerformance')}</h2>
|
||||||
<p style={{ fontSize: '12px', color: 'rgba(255,255,255,0.4)', margin: 0 }}>ADO2에서 업로드한 최근 30개의 영상 통계가 표시됩니다.</p>
|
<p style={{ fontSize: '14px', color: 'rgba(255,255,255,0.4)', margin: 0 }}>{t('dashboard.recentVideosDesc')}</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="mode-toggle">
|
<div className="mode-toggle">
|
||||||
<button
|
<button
|
||||||
className={`mode-btn ${mode === 'month' ? 'active' : ''}`}
|
className={`mode-btn ${mode === 'month' ? 'active' : ''}`}
|
||||||
onClick={() => setMode('month')}
|
onClick={() => setMode('month')}
|
||||||
>
|
>
|
||||||
연간
|
{t('dashboard.modeAnnual')}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
className={`mode-btn ${mode === 'day' ? 'active' : ''}`}
|
className={`mode-btn ${mode === 'day' ? 'active' : ''}`}
|
||||||
onClick={() => setMode('day')}
|
onClick={() => setMode('day')}
|
||||||
>
|
>
|
||||||
월간
|
{t('dashboard.modeMonthly')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -834,6 +869,7 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
|||||||
currentLabel={chartCurrentLabel}
|
currentLabel={chartCurrentLabel}
|
||||||
previousLabel={chartPreviousLabel}
|
previousLabel={chartPreviousLabel}
|
||||||
mode={mode}
|
mode={mode}
|
||||||
|
noDataLabel={t('dashboard.noDataInPeriod')}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -858,7 +894,7 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
|||||||
<AnimatedSection delay={1000} className="audience-section">
|
<AnimatedSection delay={1000} className="audience-section">
|
||||||
<div style={{ marginBottom: '16px' }}>
|
<div style={{ marginBottom: '16px' }}>
|
||||||
<h2 className="dashboard-section-title" style={{ marginBottom: '2px' }}>{t('dashboard.audienceInsights')}</h2>
|
<h2 className="dashboard-section-title" style={{ marginBottom: '2px' }}>{t('dashboard.audienceInsights')}</h2>
|
||||||
<p style={{ fontSize: '12px', color: 'rgba(255,255,255,0.4)', margin: 0 }}>선택한 채널의 통계가 표시됩니다.</p>
|
<p style={{ fontSize: '14px', color: 'rgba(255,255,255,0.4)', margin: 0 }}>{t('dashboard.channelStatsDesc')}</p>
|
||||||
</div>
|
</div>
|
||||||
<div style={{ position: 'relative' }}>
|
<div style={{ position: 'relative' }}>
|
||||||
<div className="audience-cards" style={!hasRealAudienceData && !showMockData ? { filter: 'blur(4px)', pointerEvents: 'none', userSelect: 'none' } : {}}>
|
<div className="audience-cards" style={!hasRealAudienceData && !showMockData ? { filter: 'blur(4px)', pointerEvents: 'none', userSelect: 'none' } : {}}>
|
||||||
@@ -881,7 +917,7 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
|||||||
</div>
|
</div>
|
||||||
</AnimatedItem>
|
</AnimatedItem>
|
||||||
</div>
|
</div>
|
||||||
{dashboardData && !isEmptyState && !hasRealAudienceData && (
|
{dashboardData && !isEmptyState && !hasRealAudienceData && !showMockData && (
|
||||||
<div style={{ position: 'absolute', inset: 0, display: 'flex', alignItems: 'center', justifyContent: 'center', pointerEvents: 'none' }}>
|
<div style={{ position: 'absolute', inset: 0, display: 'flex', alignItems: 'center', justifyContent: 'center', pointerEvents: 'none' }}>
|
||||||
<div style={{
|
<div style={{
|
||||||
display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '10px',
|
display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '10px',
|
||||||
@@ -890,8 +926,8 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
|||||||
borderRadius: '12px',
|
borderRadius: '12px',
|
||||||
padding: '20px 28px',
|
padding: '20px 28px',
|
||||||
}}>
|
}}>
|
||||||
<p style={{ color: 'rgba(255,255,255,0.85)', fontSize: '14px', fontWeight: 500, margin: 0, textAlign: 'center' }}>
|
<p style={{ color: 'rgba(255,255,255,0.85)', fontSize: '16px', fontWeight: 500, margin: 0, textAlign: 'center' }}>
|
||||||
누적 데이터가 부족하여 실제 시청자 정보가 없습니다.
|
{t('dashboard.noAudienceData')}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -899,38 +935,36 @@ const DashboardContent: React.FC<DashboardContentProps> = ({ onNavigate }) => {
|
|||||||
</div>
|
</div>
|
||||||
</AnimatedSection>
|
</AnimatedSection>
|
||||||
|
|
||||||
{/* 개발자 모드 전용: mock 데이터 블러 해제 버튼 */}
|
{/* mock 데이터 보기 버튼 */}
|
||||||
{isTestPage && isEmptyState && (
|
<button
|
||||||
<button
|
onClick={() => setShowMockData(prev => !prev)}
|
||||||
onClick={() => setShowMockData(prev => !prev)}
|
style={{
|
||||||
style={{
|
position: 'fixed',
|
||||||
position: 'fixed',
|
bottom: '24px',
|
||||||
bottom: '24px',
|
right: '24px',
|
||||||
right: '24px',
|
zIndex: 9999,
|
||||||
zIndex: 9999,
|
display: 'flex',
|
||||||
display: 'flex',
|
alignItems: 'center',
|
||||||
alignItems: 'center',
|
gap: '6px',
|
||||||
gap: '6px',
|
background: showMockData ? 'rgba(255,100,100,0.15)' : 'rgba(166,255,234,0.12)',
|
||||||
background: showMockData ? 'rgba(255,100,100,0.15)' : 'rgba(166,255,234,0.12)',
|
border: `1px solid ${showMockData ? 'rgba(255,100,100,0.4)' : 'rgba(166,255,234,0.4)'}`,
|
||||||
border: `1px solid ${showMockData ? 'rgba(255,100,100,0.4)' : 'rgba(166,255,234,0.4)'}`,
|
borderRadius: '10px',
|
||||||
borderRadius: '10px',
|
color: showMockData ? 'rgba(255,150,150,0.9)' : '#a6ffea',
|
||||||
color: showMockData ? 'rgba(255,150,150,0.9)' : '#a6ffea',
|
padding: '8px 14px',
|
||||||
padding: '8px 14px',
|
fontSize: '12px',
|
||||||
fontSize: '12px',
|
fontWeight: 600,
|
||||||
fontWeight: 600,
|
cursor: 'pointer',
|
||||||
cursor: 'pointer',
|
backdropFilter: 'blur(8px)',
|
||||||
backdropFilter: 'blur(8px)',
|
}}
|
||||||
}}
|
>
|
||||||
>
|
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||||
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
{showMockData
|
||||||
{showMockData
|
? <><path d="M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94"/><path d="M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19"/><line x1="1" y1="1" x2="23" y2="23"/></>
|
||||||
? <><path d="M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94"/><path d="M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19"/><line x1="1" y1="1" x2="23" y2="23"/></>
|
: <><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></>
|
||||||
: <><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></>
|
}
|
||||||
}
|
</svg>
|
||||||
</svg>
|
{showMockData ? t('dashboard.sampleHide') : t('dashboard.sampleShow')}
|
||||||
{showMockData ? 'Mock 숨기기' : 'Mock 보기'} [DEV]
|
</button>
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import Sidebar from '../../components/Sidebar';
|
import Sidebar from '../../components/Sidebar';
|
||||||
import AssetManagementContent from './AssetManagementContent';
|
import AssetManagementContent from './AssetManagementContent';
|
||||||
@@ -9,18 +9,23 @@ import DashboardContent from './DashboardContent';
|
|||||||
import BusinessSettingsContent from './BusinessSettingsContent';
|
import BusinessSettingsContent from './BusinessSettingsContent';
|
||||||
import UrlInputContent from './UrlInputContent';
|
import UrlInputContent from './UrlInputContent';
|
||||||
import ADO2ContentsPage from './ADO2ContentsPage';
|
import ADO2ContentsPage from './ADO2ContentsPage';
|
||||||
|
import MyContentsPage from './MyContentsPage';
|
||||||
import MyInfoContent from './MyInfoContent';
|
import MyInfoContent from './MyInfoContent';
|
||||||
import ContentCalendarContent from './ContentCalendarContent';
|
import ContentCalendarContent from './ContentCalendarContent';
|
||||||
import LoadingSection from '../Analysis/LoadingSection';
|
import LoadingSection from '../Analysis/LoadingSection';
|
||||||
import AnalysisResultSection from '../Analysis/AnalysisResultSection';
|
import AnalysisResultSection from '../Analysis/AnalysisResultSection';
|
||||||
import { ImageItem, CrawlingResponse, UserMeResponse } from '../../types/api';
|
import { ImageItem, CrawlingResponse, UserMeResponse } from '../../types/api';
|
||||||
import { crawlUrl, autocomplete, AutocompleteRequest, getUserMe, clearTokens } from '../../utils/api';
|
import { crawlUrl, autocomplete, marketingAnalysis, AutocompleteRequest, getUserMe, getUserCredits, clearTokens } from '../../utils/api';
|
||||||
|
import { useTutorial } from '../../components/Tutorial/useTutorial';
|
||||||
|
import { TUTORIAL_KEYS } from '../../components/Tutorial/tutorialSteps';
|
||||||
|
import TutorialOverlay, { TutorialRestartPopup } from '../../components/Tutorial/TutorialOverlay';
|
||||||
|
|
||||||
const WIZARD_STEP_KEY = 'castad_wizard_step';
|
const WIZARD_STEP_KEY = 'castad_wizard_step';
|
||||||
const ACTIVE_ITEM_KEY = 'castad_active_item';
|
const ACTIVE_ITEM_KEY = 'castad_active_item';
|
||||||
const SONG_TASK_ID_KEY = 'castad_song_task_id';
|
const SONG_TASK_ID_KEY = 'castad_song_task_id';
|
||||||
const IMAGE_TASK_ID_KEY = 'castad_image_task_id';
|
const IMAGE_TASK_ID_KEY = 'castad_image_task_id';
|
||||||
const ANALYSIS_DATA_KEY = 'castad_analysis_data';
|
const ANALYSIS_DATA_KEY = 'castad_analysis_data';
|
||||||
|
import { saveSearchHistory } from '../../components/SearchHistory/useSearchHistory';
|
||||||
|
|
||||||
// 다른 컴포넌트에서 사용하는 storage key들 (초기화용)
|
// 다른 컴포넌트에서 사용하는 storage key들 (초기화용)
|
||||||
const SONG_GENERATION_KEY = 'castad_song_generation';
|
const SONG_GENERATION_KEY = 'castad_song_generation';
|
||||||
@@ -111,14 +116,35 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
const [videoGenerationProgress, setVideoGenerationProgress] = useState(0);
|
const [videoGenerationProgress, setVideoGenerationProgress] = useState(0);
|
||||||
const [analysisData, setAnalysisData] = useState<CrawlingResponse | null>(parseAnalysisData());
|
const [analysisData, setAnalysisData] = useState<CrawlingResponse | null>(parseAnalysisData());
|
||||||
const [analysisError, setAnalysisError] = useState<string | null>(null);
|
const [analysisError, setAnalysisError] = useState<string | null>(null);
|
||||||
|
const [isAnalysisComplete, setIsAnalysisComplete] = useState(false);
|
||||||
const [userInfo, setUserInfo] = useState<UserMeResponse | null>(null);
|
const [userInfo, setUserInfo] = useState<UserMeResponse | null>(null);
|
||||||
|
const [credits, setCredits] = useState<number | null>(null);
|
||||||
|
const [myInfoInitialTab, setMyInfoInitialTab] = useState<'basic' | 'payment' | 'business' | undefined>(undefined);
|
||||||
|
const tutorial = useTutorial();
|
||||||
|
|
||||||
// 로그인 직후 사용자 정보 조회
|
const refreshCredits = useCallback(async () => {
|
||||||
|
try {
|
||||||
|
const { credits } = await getUserCredits();
|
||||||
|
setCredits(credits);
|
||||||
|
} catch (e) {
|
||||||
|
console.error('Failed to refresh credits:', e);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// 사운드 스튜디오, 영상 완성 진입 시 크레딧 갱신
|
||||||
|
useEffect(() => {
|
||||||
|
if (wizardStep === 2 || wizardStep === 3) {
|
||||||
|
refreshCredits();
|
||||||
|
}
|
||||||
|
}, [wizardStep]);
|
||||||
|
|
||||||
|
// 로그인 직후 사용자 정보 + 크레딧 조회
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchUserInfo = async () => {
|
const fetchUserInfo = async () => {
|
||||||
try {
|
try {
|
||||||
const data = await getUserMe();
|
const [data, creditsData] = await Promise.all([getUserMe(), getUserCredits()]);
|
||||||
setUserInfo(data);
|
setUserInfo(data);
|
||||||
|
setCredits(creditsData.credits);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to fetch user info:', error);
|
console.error('Failed to fetch user info:', error);
|
||||||
}
|
}
|
||||||
@@ -148,13 +174,18 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const [imageList, setImageList] = useState<ImageItem[]>(getInitialImageList());
|
const [imageList, setImageList] = useState<ImageItem[]>(getInitialImageList());
|
||||||
|
const prevAnalysisMIdRef = useRef<number | null | undefined>(analysisData?.m_id);
|
||||||
|
|
||||||
// analysisData 변경 시 imageList 업데이트
|
// analysisData 변경 시 m_id가 바뀐 경우(새로운 분석)에만 imageList 업데이트
|
||||||
|
// m_id가 동일하면 언어 변경 등 기타 업데이트이므로 사용자가 수정한 이미지 목록 유지
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log('[GenerationFlow] analysisData updated, m_id:', analysisData?.m_id);
|
console.log('[GenerationFlow] analysisData updated, m_id:', analysisData?.m_id);
|
||||||
if (analysisData?.image_list && analysisData.image_list.length > 0) {
|
if (analysisData?.image_list && analysisData.image_list.length > 0) {
|
||||||
setImageList(analysisData.image_list.map(url => ({ type: 'url', url })));
|
if (prevAnalysisMIdRef.current !== analysisData.m_id) {
|
||||||
|
setImageList(analysisData.image_list.map(url => ({ type: 'url', url })));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
prevAnalysisMIdRef.current = analysisData?.m_id;
|
||||||
}, [analysisData]);
|
}, [analysisData]);
|
||||||
|
|
||||||
const handleRemoveImage = (index: number) => {
|
const handleRemoveImage = (index: number) => {
|
||||||
@@ -199,6 +230,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
// 업체명 자동완성으로 분석 시작
|
// 업체명 자동완성으로 분석 시작
|
||||||
const handleAutocomplete = async (request: AutocompleteRequest) => {
|
const handleAutocomplete = async (request: AutocompleteRequest) => {
|
||||||
goToWizardStep(-1); // 로딩 상태로
|
goToWizardStep(-1); // 로딩 상태로
|
||||||
|
setIsAnalysisComplete(false);
|
||||||
setAnalysisError(null);
|
setAnalysisError(null);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -206,11 +238,11 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
console.log('[Autocomplete] Response m_id:', data.m_id);
|
console.log('[Autocomplete] Response m_id:', data.m_id);
|
||||||
|
|
||||||
// 기본값 보장
|
// 기본값 보장
|
||||||
if (data.marketing_analysis) {
|
// if (data.marketing_analysis) {
|
||||||
data.marketing_analysis.tags = data.marketing_analysis.tags || [];
|
// data.marketing_analysis.tags = data.marketing_analysis.tags || [];
|
||||||
data.marketing_analysis.facilities = data.marketing_analysis.facilities || [];
|
// data.marketing_analysis.facilities = data.marketing_analysis.facilities || [];
|
||||||
data.marketing_analysis.report = data.marketing_analysis.report || '';
|
// data.marketing_analysis.report = data.marketing_analysis.report || '';
|
||||||
}
|
// }
|
||||||
if (data.processed_info) {
|
if (data.processed_info) {
|
||||||
data.processed_info.customer_name = data.processed_info.customer_name || '알 수 없음';
|
data.processed_info.customer_name = data.processed_info.customer_name || '알 수 없음';
|
||||||
data.processed_info.region = data.processed_info.region || '';
|
data.processed_info.region = data.processed_info.region || '';
|
||||||
@@ -220,14 +252,42 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
|
|
||||||
setAnalysisData(data);
|
setAnalysisData(data);
|
||||||
localStorage.setItem(ANALYSIS_DATA_KEY, JSON.stringify(data));
|
localStorage.setItem(ANALYSIS_DATA_KEY, JSON.stringify(data));
|
||||||
goToWizardStep(0); // 브랜드 분석 결과로
|
saveSearchHistory({ type: 'name', value: request.title.replace(/<[^>]*>/g, ''), address: request.address, roadAddress: request.roadAddress });
|
||||||
|
setIsAnalysisComplete(true);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Autocomplete error:', err);
|
console.error('Autocomplete error:', err);
|
||||||
setAnalysisError(err instanceof Error ? err.message : t('app.autocompleteError'));
|
setAnalysisError(t('app.autocompleteError'));
|
||||||
goToWizardStep(-2); // URL 입력으로 돌아가기
|
goToWizardStep(-2); // URL 입력으로 돌아가기
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 업체명·주소 수동 입력으로 마케팅 분석 API 호출
|
||||||
|
const handleManualInput = async (businessName: string, address: string) => {
|
||||||
|
goToWizardStep(-1);
|
||||||
|
setIsAnalysisComplete(false);
|
||||||
|
setAnalysisError(null);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const data = await marketingAnalysis(businessName, address);
|
||||||
|
|
||||||
|
if (data.processed_info) {
|
||||||
|
data.processed_info.customer_name = data.processed_info.customer_name || businessName;
|
||||||
|
data.processed_info.region = data.processed_info.region || '';
|
||||||
|
data.processed_info.detail_region_info = data.processed_info.detail_region_info || '';
|
||||||
|
}
|
||||||
|
data.image_list = data.image_list || [];
|
||||||
|
|
||||||
|
setAnalysisData(data);
|
||||||
|
localStorage.setItem(ANALYSIS_DATA_KEY, JSON.stringify(data));
|
||||||
|
saveSearchHistory({ type: 'name', value: businessName, address, roadAddress: address });
|
||||||
|
setIsAnalysisComplete(true);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Marketing analysis error:', err);
|
||||||
|
setAnalysisError(t('app.autocompleteError'));
|
||||||
|
goToWizardStep(-2);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// 테스트용 랜덤 m_id 생성 (99 ~ 300)
|
// 테스트용 랜덤 m_id 생성 (99 ~ 300)
|
||||||
const generateRandomMId = (): number => {
|
const generateRandomMId = (): number => {
|
||||||
return Math.floor(Math.random() * (300 - 99 + 1)) + 99;
|
return Math.floor(Math.random() * (300 - 99 + 1)) + 99;
|
||||||
@@ -266,6 +326,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
if (!url.trim()) return;
|
if (!url.trim()) return;
|
||||||
|
|
||||||
goToWizardStep(-1); // 로딩 상태로
|
goToWizardStep(-1); // 로딩 상태로
|
||||||
|
setIsAnalysisComplete(false);
|
||||||
setAnalysisError(null);
|
setAnalysisError(null);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -273,11 +334,11 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
console.log('[Crawl] Response m_id:', data.m_id);
|
console.log('[Crawl] Response m_id:', data.m_id);
|
||||||
|
|
||||||
// 기본값 보장
|
// 기본값 보장
|
||||||
if (data.marketing_analysis) {
|
// if (data.marketing_analysis) {
|
||||||
data.marketing_analysis.tags = data.marketing_analysis.tags || [];
|
// data.marketing_analysis.tags = data.marketing_analysis.tags || [];
|
||||||
data.marketing_analysis.facilities = data.marketing_analysis.facilities || [];
|
// data.marketing_analysis.facilities = data.marketing_analysis.facilities || [];
|
||||||
data.marketing_analysis.report = data.marketing_analysis.report || '';
|
// data.marketing_analysis.report = data.marketing_analysis.report || '';
|
||||||
}
|
// }
|
||||||
if (data.processed_info) {
|
if (data.processed_info) {
|
||||||
data.processed_info.customer_name = data.processed_info.customer_name || '알 수 없음';
|
data.processed_info.customer_name = data.processed_info.customer_name || '알 수 없음';
|
||||||
data.processed_info.region = data.processed_info.region || '';
|
data.processed_info.region = data.processed_info.region || '';
|
||||||
@@ -287,11 +348,11 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
|
|
||||||
setAnalysisData(data);
|
setAnalysisData(data);
|
||||||
localStorage.setItem(ANALYSIS_DATA_KEY, JSON.stringify(data));
|
localStorage.setItem(ANALYSIS_DATA_KEY, JSON.stringify(data));
|
||||||
goToWizardStep(0); // 브랜드 분석 결과로
|
saveSearchHistory({ type: 'url', value: url });
|
||||||
|
setIsAnalysisComplete(true);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Crawling failed:', err);
|
console.error('Crawling failed:', err);
|
||||||
const errorMessage = err instanceof Error ? err.message : t('app.analysisError');
|
setAnalysisError(t('app.analysisError'));
|
||||||
setAnalysisError(errorMessage);
|
|
||||||
goToWizardStep(-2); // URL 입력으로 돌아가기
|
goToWizardStep(-2); // URL 입력으로 돌아가기
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -311,8 +372,44 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
localStorage.setItem(ACTIVE_ITEM_KEY, activeItem);
|
localStorage.setItem(ACTIVE_ITEM_KEY, activeItem);
|
||||||
}, [activeItem]);
|
}, [activeItem]);
|
||||||
|
|
||||||
|
// wizardStep 변경 시 튜토리얼 트리거 (사이드바 메뉴 화면에서는 제외)
|
||||||
|
const SIDEBAR_ITEMS = ['대시보드', 'ADO2 콘텐츠', '내 정보', '콘텐츠 캘린더'];
|
||||||
|
useEffect(() => {
|
||||||
|
if (tutorial.isActive) tutorial.skipTutorial();
|
||||||
|
if (SIDEBAR_ITEMS.includes(activeItem)) return;
|
||||||
|
const timer = setTimeout(() => {
|
||||||
|
if (wizardStep === 1 && !tutorial.hasSeen(TUTORIAL_KEYS.ASSET)) {
|
||||||
|
tutorial.startTutorial(TUTORIAL_KEYS.ASSET);
|
||||||
|
} else if (wizardStep === 2 && !tutorial.hasSeen(TUTORIAL_KEYS.SOUND)) {
|
||||||
|
tutorial.startTutorial(TUTORIAL_KEYS.SOUND);
|
||||||
|
}
|
||||||
|
}, 600);
|
||||||
|
return () => clearTimeout(timer);
|
||||||
|
}, [wizardStep, activeItem]);
|
||||||
|
|
||||||
|
// activeItem 변경 시 튜토리얼 트리거
|
||||||
|
useEffect(() => {
|
||||||
|
if (tutorial.isActive) tutorial.skipTutorial();
|
||||||
|
if (activeItem === '내 정보' && !tutorial.hasSeen(TUTORIAL_KEYS.MY_INFO)) {
|
||||||
|
tutorial.startTutorial(TUTORIAL_KEYS.MY_INFO);
|
||||||
|
} else if (activeItem === '내 콘텐츠' && !tutorial.hasSeen(TUTORIAL_KEYS.ADO2_CONTENTS)) {
|
||||||
|
tutorial.startTutorial(TUTORIAL_KEYS.ADO2_CONTENTS);
|
||||||
|
} else if (activeItem === '대시보드' && !tutorial.hasSeen(TUTORIAL_KEYS.DASHBOARD)) {
|
||||||
|
tutorial.startTutorial(TUTORIAL_KEYS.DASHBOARD);
|
||||||
|
} else if (activeItem === '콘텐츠 캘린더' && !tutorial.hasSeen(TUTORIAL_KEYS.CONTENT_CALENDAR)) {
|
||||||
|
tutorial.startTutorial(TUTORIAL_KEYS.CONTENT_CALENDAR);
|
||||||
|
}
|
||||||
|
}, [activeItem]);
|
||||||
|
|
||||||
|
// 결제 탭으로 바로 이동하는 핸들러 (크레딧 충전하기 버튼용)
|
||||||
|
const handleGoToPayment = () => {
|
||||||
|
setMyInfoInitialTab('payment');
|
||||||
|
setActiveItem('내 정보');
|
||||||
|
};
|
||||||
|
|
||||||
// 네비게이션 핸들러 - "새 프로젝트 만들기" 클릭 시 기존 프로젝트 데이터 초기화
|
// 네비게이션 핸들러 - "새 프로젝트 만들기" 클릭 시 기존 프로젝트 데이터 초기화
|
||||||
const handleNavigate = (item: string) => {
|
const handleNavigate = (item: string) => {
|
||||||
|
setMyInfoInitialTab(undefined);
|
||||||
if (item === '새 프로젝트 만들기') {
|
if (item === '새 프로젝트 만들기') {
|
||||||
// 기존 프로젝트 데이터 초기화
|
// 기존 프로젝트 데이터 초기화
|
||||||
clearAllProjectStorage();
|
clearAllProjectStorage();
|
||||||
@@ -329,6 +426,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
setAnalysisError(null);
|
setAnalysisError(null);
|
||||||
}
|
}
|
||||||
setActiveItem(item);
|
setActiveItem(item);
|
||||||
|
refreshCredits();
|
||||||
};
|
};
|
||||||
|
|
||||||
// 새 프로젝트 만들기 - 단계별 컨텐츠 렌더링
|
// 새 프로젝트 만들기 - 단계별 컨텐츠 렌더링
|
||||||
@@ -340,13 +438,19 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
<UrlInputContent
|
<UrlInputContent
|
||||||
onAnalyze={handleStartAnalysis}
|
onAnalyze={handleStartAnalysis}
|
||||||
onAutocomplete={handleAutocomplete}
|
onAutocomplete={handleAutocomplete}
|
||||||
|
onManualInput={handleManualInput}
|
||||||
onTestData={handleTestData}
|
onTestData={handleTestData}
|
||||||
error={analysisError}
|
error={analysisError}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
case -1:
|
case -1:
|
||||||
// 로딩 단계
|
// 로딩 단계
|
||||||
return <LoadingSection />;
|
return (
|
||||||
|
<LoadingSection
|
||||||
|
isComplete={isAnalysisComplete}
|
||||||
|
onComplete={() => goToWizardStep(0)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
case 0:
|
case 0:
|
||||||
// 브랜드 분석 결과 단계
|
// 브랜드 분석 결과 단계
|
||||||
if (!analysisData) {
|
if (!analysisData) {
|
||||||
@@ -394,6 +498,14 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
mId={analysisData?.m_id ?? 0}
|
mId={analysisData?.m_id ?? 0}
|
||||||
videoGenerationStatus={videoGenerationStatus}
|
videoGenerationStatus={videoGenerationStatus}
|
||||||
videoGenerationProgress={videoGenerationProgress}
|
videoGenerationProgress={videoGenerationProgress}
|
||||||
|
onGoToPayment={handleGoToPayment}
|
||||||
|
onStatusChange={(status: string) => {
|
||||||
|
if (status === 'generating_song' && !tutorial.hasSeen(TUTORIAL_KEYS.SOUND_LYRICS)) {
|
||||||
|
setTimeout(() => tutorial.startTutorial(TUTORIAL_KEYS.SOUND_LYRICS), 400);
|
||||||
|
} else if (status === 'complete' && !tutorial.hasSeen(TUTORIAL_KEYS.SOUND_AUDIO)) {
|
||||||
|
setTimeout(() => tutorial.startTutorial(TUTORIAL_KEYS.SOUND_AUDIO), 400);
|
||||||
|
}
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
case 3:
|
case 3:
|
||||||
@@ -411,6 +523,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
songTaskId={songTaskId}
|
songTaskId={songTaskId}
|
||||||
onVideoStatusChange={setVideoGenerationStatus}
|
onVideoStatusChange={setVideoGenerationStatus}
|
||||||
onVideoProgressChange={setVideoGenerationProgress}
|
onVideoProgressChange={setVideoGenerationProgress}
|
||||||
|
onGoToCalendar={() => handleNavigate('콘텐츠 캘린더')}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
default:
|
default:
|
||||||
@@ -425,15 +538,18 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
case '비즈니스 설정':
|
case '비즈니스 설정':
|
||||||
return <BusinessSettingsContent />;
|
return <BusinessSettingsContent />;
|
||||||
case 'ADO2 콘텐츠':
|
case 'ADO2 콘텐츠':
|
||||||
|
return <ADO2ContentsPage />;
|
||||||
|
case '내 콘텐츠':
|
||||||
return (
|
return (
|
||||||
<ADO2ContentsPage
|
<MyContentsPage
|
||||||
onBack={() => setActiveItem('새 프로젝트 만들기')}
|
onBack={() => setActiveItem('새 프로젝트 만들기')}
|
||||||
|
onNavigate={handleNavigate}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
case '콘텐츠 캘린더':
|
case '콘텐츠 캘린더':
|
||||||
return <ContentCalendarContent onNavigate={handleNavigate} />;
|
return <ContentCalendarContent onNavigate={handleNavigate} />;
|
||||||
case '내 정보':
|
case '내 정보':
|
||||||
return <MyInfoContent />;
|
return <MyInfoContent initialTab={myInfoInitialTab} />;
|
||||||
case '새 프로젝트 만들기':
|
case '새 프로젝트 만들기':
|
||||||
// 브랜드 분석(0)과 로딩(-1)은 전체 화면으로 표시
|
// 브랜드 분석(0)과 로딩(-1)은 전체 화면으로 표시
|
||||||
if (wizardStep === 0 || wizardStep === -1) {
|
if (wizardStep === 0 || wizardStep === -1) {
|
||||||
@@ -459,18 +575,69 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
// 브랜드 분석(0)일 때는 전체 페이지 스크롤
|
// 브랜드 분석(0)일 때는 전체 페이지 스크롤
|
||||||
const isBrandAnalysis = activeItem === '새 프로젝트 만들기' && wizardStep === 0;
|
const isBrandAnalysis = activeItem === '새 프로젝트 만들기' && wizardStep === 0;
|
||||||
// 스크롤이 필요한 페이지: 대시보드, 비즈니스 설정, 브랜드 분석(0), ADO2 콘텐츠, 내 정보
|
// 스크롤이 필요한 페이지: 대시보드, 비즈니스 설정, 브랜드 분석(0), ADO2 콘텐츠, 내 정보
|
||||||
const needsScroll = activeItem === '대시보드' || activeItem === '비즈니스 설정' || activeItem === 'ADO2 콘텐츠' || activeItem === '내 정보' || activeItem === '콘텐츠 캘린더' || isBrandAnalysis;
|
const needsScroll = activeItem === '대시보드' || activeItem === '비즈니스 설정' || activeItem === 'ADO2 콘텐츠' || activeItem === '내 콘텐츠' || activeItem === '내 정보' || activeItem === '콘텐츠 캘린더' || isBrandAnalysis;
|
||||||
|
|
||||||
|
// 현재 화면에 맞는 튜토리얼 키 반환 (없으면 null)
|
||||||
|
const getCurrentTutorialKey = (): string | null => {
|
||||||
|
if (activeItem === '내 정보') return TUTORIAL_KEYS.MY_INFO;
|
||||||
|
if (activeItem === '내 콘텐츠') return TUTORIAL_KEYS.ADO2_CONTENTS;
|
||||||
|
if (activeItem === '대시보드') return TUTORIAL_KEYS.DASHBOARD;
|
||||||
|
if (activeItem === '콘텐츠 캘린더') return TUTORIAL_KEYS.CONTENT_CALENDAR;
|
||||||
|
if (activeItem === '새 프로젝트 만들기') {
|
||||||
|
if (wizardStep === 1) return TUTORIAL_KEYS.ASSET;
|
||||||
|
if (wizardStep === 2) return TUTORIAL_KEYS.SOUND;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
const tutorialUI = (
|
||||||
|
<>
|
||||||
|
{getCurrentTutorialKey() && (
|
||||||
|
<button
|
||||||
|
className={`tutorial-toggle-fab ${tutorial.isEnabled ? 'active' : ''}`}
|
||||||
|
onClick={() => tutorial.toggleTutorial(getCurrentTutorialKey())}
|
||||||
|
title={tutorial.isEnabled ? t('sidebar.tutorialOff') : t('sidebar.tutorialOn')}
|
||||||
|
>
|
||||||
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||||
|
<circle cx="12" cy="12" r="10"/>
|
||||||
|
<path d="M12 8v4l3 3"/>
|
||||||
|
</svg>
|
||||||
|
<span>{t('sidebar.tutorial')}</span>
|
||||||
|
<span className={`tutorial-toggle-badge ${tutorial.isEnabled ? 'on' : 'off'}`}>
|
||||||
|
{tutorial.isEnabled ? 'ON' : 'OFF'}
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
{tutorial.isActive && (
|
||||||
|
<TutorialOverlay
|
||||||
|
hints={tutorial.hints}
|
||||||
|
currentIndex={tutorial.currentHintIndex}
|
||||||
|
onNext={tutorial.nextHint}
|
||||||
|
onPrev={tutorial.prevHint}
|
||||||
|
onSkip={tutorial.skipTutorial}
|
||||||
|
groupProgress={tutorial.groupProgress}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{tutorial.isRestartPopupVisible && (
|
||||||
|
<TutorialRestartPopup
|
||||||
|
onConfirm={tutorial.confirmRestart}
|
||||||
|
onCancel={tutorial.cancelRestart}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
|
||||||
// 브랜드 분석일 때는 전체 화면 스크롤
|
// 브랜드 분석일 때는 전체 화면 스크롤
|
||||||
if (isBrandAnalysis) {
|
if (isBrandAnalysis) {
|
||||||
return (
|
return (
|
||||||
<div className="analysis-page-wrapper">
|
<div className="analysis-page-wrapper">
|
||||||
{showSidebar && (
|
{showSidebar && (
|
||||||
<Sidebar activeItem={activeItem} onNavigate={handleNavigate} onHome={handleHome} userInfo={userInfo} onLogout={handleLogout} />
|
<Sidebar activeItem={activeItem} onNavigate={handleNavigate} onHome={handleHome} userInfo={userInfo} onLogout={handleLogout} credits={credits} tutorialAvailable={!!getCurrentTutorialKey()} tutorialEnabled={tutorial.isEnabled} onToggleTutorial={() => tutorial.toggleTutorial(getCurrentTutorialKey())} />
|
||||||
)}
|
)}
|
||||||
<main className="analysis-page-main">
|
<main className="analysis-page-main">
|
||||||
{renderContent()}
|
{renderContent()}
|
||||||
</main>
|
</main>
|
||||||
|
{tutorialUI}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -478,8 +645,9 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
|||||||
return (
|
return (
|
||||||
<div className={`flex w-full bg-[#002224] text-white ${needsScroll ? 'min-h-[100dvh]' : 'h-[100dvh] overflow-hidden'}`}>
|
<div className={`flex w-full bg-[#002224] text-white ${needsScroll ? 'min-h-[100dvh]' : 'h-[100dvh] overflow-hidden'}`}>
|
||||||
{showSidebar && (
|
{showSidebar && (
|
||||||
<Sidebar activeItem={activeItem} onNavigate={handleNavigate} onHome={handleHome} userInfo={userInfo} onLogout={handleLogout} />
|
<Sidebar activeItem={activeItem} onNavigate={handleNavigate} onHome={handleHome} userInfo={userInfo} onLogout={handleLogout} credits={credits} tutorialAvailable={!!getCurrentTutorialKey()} tutorialEnabled={tutorial.isEnabled} onToggleTutorial={() => tutorial.toggleTutorial(getCurrentTutorialKey())} />
|
||||||
)}
|
)}
|
||||||
|
{tutorialUI}
|
||||||
<div className={`flex-1 relative pl-0 md:pl-0 ${needsScroll ? 'overflow-auto' : 'h-full overflow-hidden'}`}>
|
<div className={`flex-1 relative pl-0 md:pl-0 ${needsScroll ? 'overflow-auto' : 'h-full overflow-hidden'}`}>
|
||||||
{renderContent()}
|
{renderContent()}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,399 @@
|
|||||||
|
|
||||||
|
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { getVideosList, deleteVideo } from '../../utils/api';
|
||||||
|
import { VideoListItem } from '../../types/api';
|
||||||
|
import SocialPostingModal from '../../components/SocialPostingModal';
|
||||||
|
import VideoDetailModal from '../../components/VideoDetailModal';
|
||||||
|
import { useTutorial } from '../../components/Tutorial/useTutorial';
|
||||||
|
import { TUTORIAL_KEYS } from '../../components/Tutorial/tutorialSteps';
|
||||||
|
|
||||||
|
const VideoPreviewCard: React.FC<{ src: string; className?: string }> = ({ src, className }) => {
|
||||||
|
const videoRef = useRef<HTMLVideoElement>(null);
|
||||||
|
const isPlayingRef = useRef(false);
|
||||||
|
const pendingPlayRef = useRef(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const video = videoRef.current;
|
||||||
|
if (!video) return;
|
||||||
|
|
||||||
|
const observer = new IntersectionObserver(
|
||||||
|
([entry]) => {
|
||||||
|
if (entry.isIntersecting) {
|
||||||
|
video.preload = 'auto';
|
||||||
|
} else {
|
||||||
|
video.preload = 'none';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ threshold: 0.1 }
|
||||||
|
);
|
||||||
|
|
||||||
|
observer.observe(video);
|
||||||
|
return () => observer.disconnect();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const safePlay = useCallback((video: HTMLVideoElement) => {
|
||||||
|
const playPromise = video.play();
|
||||||
|
if (playPromise !== undefined) {
|
||||||
|
playPromise
|
||||||
|
.then(() => { isPlayingRef.current = true; })
|
||||||
|
.catch((error) => {
|
||||||
|
if (error.name !== 'AbortError') console.error(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handleCanPlay = useCallback(() => {
|
||||||
|
if (!pendingPlayRef.current || !videoRef.current) return;
|
||||||
|
pendingPlayRef.current = false;
|
||||||
|
safePlay(videoRef.current);
|
||||||
|
}, [safePlay]);
|
||||||
|
|
||||||
|
const handleMouseEnter = useCallback(() => {
|
||||||
|
const video = videoRef.current;
|
||||||
|
if (!video) return;
|
||||||
|
if (video.readyState >= 3) {
|
||||||
|
safePlay(video);
|
||||||
|
} else {
|
||||||
|
pendingPlayRef.current = true;
|
||||||
|
}
|
||||||
|
}, [safePlay]);
|
||||||
|
|
||||||
|
const handleMouseLeave = useCallback(() => {
|
||||||
|
const video = videoRef.current;
|
||||||
|
if (!video) return;
|
||||||
|
pendingPlayRef.current = false;
|
||||||
|
if (isPlayingRef.current) {
|
||||||
|
video.pause();
|
||||||
|
video.currentTime = 0;
|
||||||
|
isPlayingRef.current = false;
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<video
|
||||||
|
ref={videoRef}
|
||||||
|
src={src}
|
||||||
|
className={className}
|
||||||
|
muted
|
||||||
|
playsInline
|
||||||
|
preload="none"
|
||||||
|
onCanPlay={handleCanPlay}
|
||||||
|
onMouseEnter={handleMouseEnter}
|
||||||
|
onMouseLeave={handleMouseLeave}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
interface MyContentsPageProps {
|
||||||
|
onBack?: () => void;
|
||||||
|
onNavigate?: (item: string) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate }) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const tutorial = useTutorial();
|
||||||
|
const [videos, setVideos] = useState<VideoListItem[]>([]);
|
||||||
|
const [total, setTotal] = useState(0);
|
||||||
|
const [loading, setLoading] = useState(true);
|
||||||
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
const [page, setPage] = useState(1);
|
||||||
|
const [hasNext, setHasNext] = useState(false);
|
||||||
|
const [hasPrev, setHasPrev] = useState(false);
|
||||||
|
const [totalPages, setTotalPages] = useState(1);
|
||||||
|
const [deleteModalOpen, setDeleteModalOpen] = useState(false);
|
||||||
|
const [deleteTargetId, setDeleteTargetId] = useState<number | null>(null);
|
||||||
|
const [isDeleting, setIsDeleting] = useState(false);
|
||||||
|
const [uploadModalOpen, setUploadModalOpen] = useState(false);
|
||||||
|
const [uploadTargetVideo, setUploadTargetVideo] = useState<VideoListItem | null>(null);
|
||||||
|
const [selectedVideoId, setSelectedVideoId] = useState<number | null>(null);
|
||||||
|
|
||||||
|
const pageSize = 12;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
fetchVideos();
|
||||||
|
}, [page]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!tutorial.hasSeen(TUTORIAL_KEYS.ADO2_CONTENTS)) {
|
||||||
|
tutorial.startTutorial(TUTORIAL_KEYS.ADO2_CONTENTS);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const fetchVideos = async () => {
|
||||||
|
setLoading(true);
|
||||||
|
setError(null);
|
||||||
|
try {
|
||||||
|
const response = await getVideosList(page, pageSize);
|
||||||
|
const validVideos = response.items.filter(video => video.result_movie_url && video.result_movie_url.trim() !== '');
|
||||||
|
setVideos(validVideos);
|
||||||
|
setTotal(response.total);
|
||||||
|
setTotalPages(response.total_pages);
|
||||||
|
setHasNext(response.has_next);
|
||||||
|
setHasPrev(response.has_prev);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to fetch videos:', err);
|
||||||
|
setError(t('ado2Contents.loadFailed'));
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const formatDate = (dateString: string) => {
|
||||||
|
const date = new Date(dateString);
|
||||||
|
const year = date.getFullYear();
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||||
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
|
const hours = String(date.getHours()).padStart(2, '0');
|
||||||
|
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||||
|
return `${year}.${month}.${day}・${hours}:${minutes}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
const formatTitle = (storeName: string, dateString: string) => {
|
||||||
|
const date = new Date(dateString);
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||||
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
|
const hours = String(date.getHours()).padStart(2, '0');
|
||||||
|
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||||
|
return `${storeName} ${month}/${day} ${hours}:${minutes}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleDownload = async (videoUrl: string, storeName: string) => {
|
||||||
|
try {
|
||||||
|
const response = await fetch(videoUrl);
|
||||||
|
const blob = await response.blob();
|
||||||
|
const url = window.URL.createObjectURL(blob);
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.href = url;
|
||||||
|
a.download = `${storeName}.mp4`;
|
||||||
|
document.body.appendChild(a);
|
||||||
|
a.click();
|
||||||
|
window.URL.revokeObjectURL(url);
|
||||||
|
document.body.removeChild(a);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Download failed:', err);
|
||||||
|
alert(t('ado2Contents.downloadFailed'));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleDeleteClick = (videoId: number) => {
|
||||||
|
setDeleteTargetId(videoId);
|
||||||
|
setDeleteModalOpen(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleUploadClick = (video: VideoListItem) => {
|
||||||
|
setUploadTargetVideo(video);
|
||||||
|
setUploadModalOpen(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleUploadModalClose = () => {
|
||||||
|
setUploadModalOpen(false);
|
||||||
|
setUploadTargetVideo(null);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleDeleteCancel = () => {
|
||||||
|
setDeleteModalOpen(false);
|
||||||
|
setDeleteTargetId(null);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleDeleteConfirm = async () => {
|
||||||
|
if (!deleteTargetId) return;
|
||||||
|
setIsDeleting(true);
|
||||||
|
try {
|
||||||
|
await deleteVideo(deleteTargetId);
|
||||||
|
setVideos(prev => prev.filter(video => video.video_id !== deleteTargetId));
|
||||||
|
setTotal(prev => Math.max(0, prev - 1));
|
||||||
|
setDeleteModalOpen(false);
|
||||||
|
setDeleteTargetId(null);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Delete failed:', err);
|
||||||
|
alert(t('ado2Contents.deleteFailed'));
|
||||||
|
} finally {
|
||||||
|
setIsDeleting(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="ado2-contents-page">
|
||||||
|
{/* Header */}
|
||||||
|
<div className="ado2-contents-header">
|
||||||
|
<h1 className="ado2-contents-title">{t('sidebar.myContents')}</h1>
|
||||||
|
<span className="ado2-contents-count">{t('ado2Contents.totalCount', { count: total })}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Content Grid */}
|
||||||
|
{loading ? (
|
||||||
|
<div className="ado2-contents-loading">
|
||||||
|
<div className="loading-spinner"></div>
|
||||||
|
<p>{t('ado2Contents.loading')}</p>
|
||||||
|
</div>
|
||||||
|
) : error ? (
|
||||||
|
<div className="ado2-contents-error">
|
||||||
|
<p>{error}</p>
|
||||||
|
<button onClick={fetchVideos} className="retry-btn">{t('ado2Contents.retry')}</button>
|
||||||
|
</div>
|
||||||
|
) : videos.length === 0 ? (
|
||||||
|
<div className="ado2-contents-empty">
|
||||||
|
<p>{t('ado2Contents.noContent')}</p>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<div className="ado2-contents-grid">
|
||||||
|
{videos.map((video) => (
|
||||||
|
<div key={video.task_id} className="ado2-content-card">
|
||||||
|
{/* Video Thumbnail */}
|
||||||
|
<div
|
||||||
|
className="content-card-thumbnail"
|
||||||
|
style={{ cursor: 'pointer' }}
|
||||||
|
onClick={() => setSelectedVideoId(video.video_id)}
|
||||||
|
>
|
||||||
|
{video.result_movie_url ? (
|
||||||
|
<VideoPreviewCard
|
||||||
|
src={video.result_movie_url}
|
||||||
|
className="content-video-preview"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<div className="content-no-video">
|
||||||
|
<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
|
||||||
|
<rect x="2" y="2" width="20" height="20" rx="2.18" ry="2.18"/>
|
||||||
|
<line x1="7" y1="2" x2="7" y2="22"/>
|
||||||
|
<line x1="17" y1="2" x2="17" y2="22"/>
|
||||||
|
<line x1="2" y1="12" x2="22" y2="12"/>
|
||||||
|
<line x1="2" y1="7" x2="7" y2="7"/>
|
||||||
|
<line x1="2" y1="17" x2="7" y2="17"/>
|
||||||
|
<line x1="17" y1="17" x2="22" y2="17"/>
|
||||||
|
<line x1="17" y1="7" x2="22" y2="7"/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Card Info */}
|
||||||
|
<div className="content-card-info">
|
||||||
|
<div className="content-card-text">
|
||||||
|
<h3 className="content-card-title">
|
||||||
|
{formatTitle(video.store_name, video.created_at)}
|
||||||
|
</h3>
|
||||||
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
||||||
|
<p className="content-card-date">
|
||||||
|
{formatDate(video.created_at)}
|
||||||
|
</p>
|
||||||
|
<span className="content-card-like">
|
||||||
|
<svg width="15" height="15" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" strokeWidth="2">
|
||||||
|
<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/>
|
||||||
|
</svg>
|
||||||
|
{video.like_count ?? 0}
|
||||||
|
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" style={{ marginLeft: '6px' }}>
|
||||||
|
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>
|
||||||
|
</svg>
|
||||||
|
{video.comment_count ?? 0}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Action Buttons */}
|
||||||
|
<div className="content-card-actions">
|
||||||
|
<button
|
||||||
|
className="content-download-btn"
|
||||||
|
onClick={() => handleUploadClick(video)}
|
||||||
|
disabled={!video.result_movie_url}
|
||||||
|
>
|
||||||
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.5">
|
||||||
|
<path d="M10 13V3M10 3l-4 4M10 3l4 4"/>
|
||||||
|
<path d="M3 15v2h14v-2"/>
|
||||||
|
</svg>
|
||||||
|
<span>{t('ado2Contents.uploadToSocial')}</span>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className="content-upload-btn"
|
||||||
|
onClick={() => handleDownload(video.result_movie_url, video.store_name)}
|
||||||
|
disabled={!video.result_movie_url}
|
||||||
|
title={t('ado2Contents.download')}
|
||||||
|
>
|
||||||
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.5">
|
||||||
|
<path d="M10 3v10M10 13l-4-4M10 13l4-4"/>
|
||||||
|
<path d="M3 15v2h14v-2"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className="content-delete-btn"
|
||||||
|
onClick={() => handleDeleteClick(video.video_id)}
|
||||||
|
>
|
||||||
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.5">
|
||||||
|
<path d="M3 5h14M8 5V3h4v2M6 5v12h8V5"/>
|
||||||
|
<line x1="8" y1="8" x2="8" y2="14"/>
|
||||||
|
<line x1="12" y1="8" x2="12" y2="14"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Pagination */}
|
||||||
|
<div className="ado2-contents-pagination">
|
||||||
|
<button
|
||||||
|
className="pagination-btn"
|
||||||
|
onClick={() => setPage(p => p - 1)}
|
||||||
|
disabled={!hasPrev}
|
||||||
|
>
|
||||||
|
{t('ado2Contents.previous')}
|
||||||
|
</button>
|
||||||
|
<span className="pagination-info">{page} / {totalPages}</span>
|
||||||
|
<button
|
||||||
|
className="pagination-btn"
|
||||||
|
onClick={() => setPage(p => p + 1)}
|
||||||
|
disabled={!hasNext}
|
||||||
|
>
|
||||||
|
{t('ado2Contents.next')}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* 삭제 확인 모달 */}
|
||||||
|
{deleteModalOpen && (
|
||||||
|
<div className="delete-modal-overlay" onClick={handleDeleteCancel}>
|
||||||
|
<div className="delete-modal" onClick={(e: React.MouseEvent) => e.stopPropagation()}>
|
||||||
|
<h2 className="delete-modal-title">{t('ado2Contents.deleteConfirmTitle')}</h2>
|
||||||
|
<p className="delete-modal-description">{t('ado2Contents.deleteConfirmDesc')}</p>
|
||||||
|
<div className="delete-modal-actions">
|
||||||
|
<button
|
||||||
|
className="delete-modal-btn cancel"
|
||||||
|
onClick={handleDeleteCancel}
|
||||||
|
disabled={isDeleting}
|
||||||
|
>
|
||||||
|
{t('ado2Contents.cancel')}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className="delete-modal-btn confirm"
|
||||||
|
onClick={handleDeleteConfirm}
|
||||||
|
disabled={isDeleting}
|
||||||
|
>
|
||||||
|
{isDeleting ? t('ado2Contents.deleting') : t('ado2Contents.delete')}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{selectedVideoId !== null && (
|
||||||
|
<VideoDetailModal
|
||||||
|
videoId={String(selectedVideoId)}
|
||||||
|
onClose={() => setSelectedVideoId(null)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* 소셜 미디어 업로드 모달 */}
|
||||||
|
<SocialPostingModal
|
||||||
|
isOpen={uploadModalOpen}
|
||||||
|
onClose={handleUploadModalClose}
|
||||||
|
video={uploadTargetVideo}
|
||||||
|
onGoToCalendar={onNavigate ? () => onNavigate('콘텐츠 캘린더') : undefined}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default MyContentsPage;
|
||||||
@@ -1,18 +1,53 @@
|
|||||||
|
|
||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { getSocialAccounts, getYouTubeConnectUrl, disconnectSocialAccount, TokenExpiredError, handleSocialReconnect } from '../../utils/api';
|
import { getSocialAccounts, getYouTubeConnectUrl, disconnectSocialAccount, TokenExpiredError, handleSocialReconnect, getUserCredits, requestCreditCharge } from '../../utils/api';
|
||||||
import { SocialAccount } from '../../types/api';
|
import { SocialAccount } from '../../types/api';
|
||||||
|
|
||||||
type TabType = 'basic' | 'payment' | 'business';
|
type TabType = 'basic' | 'payment' | 'business';
|
||||||
|
|
||||||
const MyInfoContent: React.FC = () => {
|
interface MyInfoContentProps {
|
||||||
|
initialTab?: TabType;
|
||||||
|
}
|
||||||
|
|
||||||
|
const MyInfoContent: React.FC<MyInfoContentProps> = ({ initialTab }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [activeTab, setActiveTab] = useState<TabType>('business');
|
const [activeTab, setActiveTab] = useState<TabType>(initialTab || 'business');
|
||||||
const [businessUrl, setBusinessUrl] = useState('');
|
const [businessUrl, setBusinessUrl] = useState('');
|
||||||
const [socialAccounts, setSocialAccounts] = useState<SocialAccount[]>([]);
|
const [socialAccounts, setSocialAccounts] = useState<SocialAccount[]>([]);
|
||||||
const [isLoadingAccounts, setIsLoadingAccounts] = useState(false);
|
const [isLoadingAccounts, setIsLoadingAccounts] = useState(false);
|
||||||
const [isConnecting, setIsConnecting] = useState<string | null>(null);
|
const [isConnecting, setIsConnecting] = useState<string | null>(null);
|
||||||
|
const [credits, setCredits] = useState<number | null>(null);
|
||||||
|
const [isLoadingCredits, setIsLoadingCredits] = useState(false);
|
||||||
|
const [showChargePopup, setShowChargePopup] = useState(false);
|
||||||
|
const [chargeAmount, setChargeAmount] = useState('');
|
||||||
|
const [chargeNote, setChargeNote] = useState('');
|
||||||
|
const [isRequesting, setIsRequesting] = useState(false);
|
||||||
|
const [chargeSuccess, setChargeSuccess] = useState(false);
|
||||||
|
|
||||||
|
// initialTab 변경 시 탭 업데이트
|
||||||
|
useEffect(() => {
|
||||||
|
if (initialTab) setActiveTab(initialTab);
|
||||||
|
}, [initialTab]);
|
||||||
|
|
||||||
|
// 크레딧 로드
|
||||||
|
useEffect(() => {
|
||||||
|
if (activeTab === 'payment') {
|
||||||
|
loadCredits();
|
||||||
|
}
|
||||||
|
}, [activeTab]);
|
||||||
|
|
||||||
|
const loadCredits = async () => {
|
||||||
|
setIsLoadingCredits(true);
|
||||||
|
try {
|
||||||
|
const data = await getUserCredits();
|
||||||
|
setCredits(data.credits);
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Failed to load credits:', error);
|
||||||
|
} finally {
|
||||||
|
setIsLoadingCredits(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// 소셜 계정 목록 로드
|
// 소셜 계정 목록 로드
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -78,12 +113,80 @@ const MyInfoContent: React.FC = () => {
|
|||||||
const hasConnectedAccounts = youtubeAccounts.length > 0 || instagramAccounts.length > 0;
|
const hasConnectedAccounts = youtubeAccounts.length > 0 || instagramAccounts.length > 0;
|
||||||
|
|
||||||
const tabs = [
|
const tabs = [
|
||||||
{ id: 'basic' as TabType, label: t('myInfo.tabBasic') },
|
// { id: 'basic' as TabType, label: t('myInfo.tabBasic') },
|
||||||
{ id: 'payment' as TabType, label: t('myInfo.tabPayment') },
|
{ id: 'payment' as TabType, label: t('myInfo.tabPayment') },
|
||||||
{ id: 'business' as TabType, label: t('myInfo.tabBusiness') },
|
{ id: 'business' as TabType, label: t('myInfo.tabBusiness') },
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
|
{showChargePopup && (
|
||||||
|
<div className="myinfo-popup-overlay" onClick={() => { setShowChargePopup(false); setChargeSuccess(false); setChargeAmount(''); setChargeNote(''); }}>
|
||||||
|
<div className="myinfo-popup" onClick={e => e.stopPropagation()}>
|
||||||
|
{chargeSuccess ? (
|
||||||
|
<>
|
||||||
|
<p className="myinfo-popup-message">{t('myInfo.chargeSuccess')}</p>
|
||||||
|
<button className="myinfo-popup-close" onClick={() => { setShowChargePopup(false); setChargeSuccess(false); setChargeAmount(''); setChargeNote(''); }}>{t('myInfo.chargeConfirm')}</button>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<h3 className="myinfo-popup-title">{t('myInfo.chargePopupTitle')}</h3>
|
||||||
|
<div className="myinfo-popup-field">
|
||||||
|
<label className="myinfo-popup-label">{t('myInfo.chargeAmountLabel')}</label>
|
||||||
|
<div className="myinfo-popup-counter">
|
||||||
|
<button
|
||||||
|
className="myinfo-popup-counter-btn"
|
||||||
|
onClick={() => setChargeAmount(v => String(Math.max(1, Number(v || 0) - 1)))}
|
||||||
|
>−</button>
|
||||||
|
<input
|
||||||
|
type="number"
|
||||||
|
className="myinfo-popup-input myinfo-popup-input--center"
|
||||||
|
placeholder="0"
|
||||||
|
value={chargeAmount}
|
||||||
|
onChange={e => setChargeAmount(e.target.value.replace(/[^0-9]/g, ''))}
|
||||||
|
min={1}
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
className="myinfo-popup-counter-btn"
|
||||||
|
onClick={() => setChargeAmount(v => String(Number(v || 0) + 1))}
|
||||||
|
>+</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="myinfo-popup-field">
|
||||||
|
<label className="myinfo-popup-label">{t('myInfo.chargeNoteLabel')}</label>
|
||||||
|
<textarea
|
||||||
|
className="myinfo-popup-textarea"
|
||||||
|
placeholder={t('myInfo.chargeNotePlaceholder')}
|
||||||
|
value={chargeNote}
|
||||||
|
onChange={e => setChargeNote(e.target.value)}
|
||||||
|
rows={3}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="myinfo-popup-actions">
|
||||||
|
<button className="myinfo-popup-cancel" onClick={() => { setShowChargePopup(false); setChargeAmount(''); setChargeNote(''); }}>{t('myInfo.chargeCancel')}</button>
|
||||||
|
<button
|
||||||
|
className="myinfo-popup-close"
|
||||||
|
disabled={!chargeAmount || isRequesting}
|
||||||
|
onClick={async () => {
|
||||||
|
setIsRequesting(true);
|
||||||
|
try {
|
||||||
|
await requestCreditCharge(Number(chargeAmount), chargeNote);
|
||||||
|
} catch (e) {
|
||||||
|
console.error('Charge request failed:', e);
|
||||||
|
} finally {
|
||||||
|
setIsRequesting(false);
|
||||||
|
setChargeSuccess(true);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{isRequesting ? t('myInfo.chargeSubmitting') : t('myInfo.chargeSubmit')}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
<main className="myinfo-page">
|
<main className="myinfo-page">
|
||||||
<h1 className="myinfo-title">{t('myInfo.title')}</h1>
|
<h1 className="myinfo-title">{t('myInfo.title')}</h1>
|
||||||
|
|
||||||
@@ -102,21 +205,42 @@ const MyInfoContent: React.FC = () => {
|
|||||||
|
|
||||||
{/* 탭 컨텐츠 */}
|
{/* 탭 컨텐츠 */}
|
||||||
<div className="myinfo-content">
|
<div className="myinfo-content">
|
||||||
{activeTab === 'basic' && (
|
{/* {activeTab === 'basic' && (
|
||||||
<div className="myinfo-section">
|
<div className="myinfo-section">
|
||||||
<p className="myinfo-placeholder">{t('myInfo.basicPlaceholder')}</p>
|
<p className="myinfo-placeholder">{t('myInfo.basicPlaceholder')}</p>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)} */}
|
||||||
|
|
||||||
{activeTab === 'payment' && (
|
{activeTab === 'payment' && (
|
||||||
<div className="myinfo-section">
|
<div className="myinfo-section">
|
||||||
<p className="myinfo-placeholder">{t('myInfo.paymentPlaceholder')}</p>
|
<h2 className="myinfo-section-title">{t('myInfo.creditsTitle')}</h2>
|
||||||
|
<div className="myinfo-credits-card">
|
||||||
|
{isLoadingCredits ? (
|
||||||
|
<p className="myinfo-placeholder">{t('myInfo.creditsLoading')}</p>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<div className="myinfo-credits-row">
|
||||||
|
<span className="myinfo-credits-label">{t('myInfo.creditsLabel')}</span>
|
||||||
|
<span className="myinfo-credits-value">{credits !== null ? credits.toLocaleString() : '-'} {t('myInfo.creditsUnit')}</span>
|
||||||
|
</div>
|
||||||
|
<div className="myinfo-credits-row">
|
||||||
|
<p className="myinfo-credits-desc">{t('myInfo.creditsDesc')}</p>
|
||||||
|
<button
|
||||||
|
className="myinfo-credits-charge-btn"
|
||||||
|
onClick={() => setShowChargePopup(true)}
|
||||||
|
>
|
||||||
|
{t('myInfo.creditsChargeBtn')}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{activeTab === 'business' && (
|
{activeTab === 'business' && (
|
||||||
<>
|
<>
|
||||||
{/* 내 비즈니스 섹션 */}
|
{/* 내 비즈니스 섹션
|
||||||
<div className="myinfo-section">
|
<div className="myinfo-section">
|
||||||
<h2 className="myinfo-section-title">{t('myInfo.myBusiness')}</h2>
|
<h2 className="myinfo-section-title">{t('myInfo.myBusiness')}</h2>
|
||||||
<div className="myinfo-business-card">
|
<div className="myinfo-business-card">
|
||||||
@@ -137,7 +261,7 @@ const MyInfoContent: React.FC = () => {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> */}
|
||||||
|
|
||||||
{/* 소셜 채널 섹션 */}
|
{/* 소셜 채널 섹션 */}
|
||||||
<div className="myinfo-section">
|
<div className="myinfo-section">
|
||||||
@@ -250,6 +374,7 @@ const MyInfoContent: React.FC = () => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -16,14 +16,29 @@ interface SoundStudioContentProps {
|
|||||||
businessInfo?: BusinessInfo;
|
businessInfo?: BusinessInfo;
|
||||||
imageTaskId: string | null;
|
imageTaskId: string | null;
|
||||||
mId: number;
|
mId: number;
|
||||||
|
onStatusChange?: (status: string) => void;
|
||||||
videoGenerationStatus?: 'idle' | 'generating' | 'complete' | 'error';
|
videoGenerationStatus?: 'idle' | 'generating' | 'complete' | 'error';
|
||||||
videoGenerationProgress?: number;
|
videoGenerationProgress?: number;
|
||||||
|
onGoToPayment?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
type GenerationStatus = 'idle' | 'generating_lyric' | 'generating_song' | 'polling' | 'complete' | 'error';
|
type GenerationStatus = 'idle' | 'generating_lyric' | 'generating_song' | 'polling' | 'complete' | 'error';
|
||||||
|
|
||||||
const MAX_RETRY_COUNT = 3;
|
const MAX_RETRY_COUNT = 3;
|
||||||
|
|
||||||
|
const sanitizeError = (message: string, fallback: string): string => {
|
||||||
|
if (
|
||||||
|
message.includes('Traceback') ||
|
||||||
|
message.includes('File "/') ||
|
||||||
|
message.includes('httpx.') ||
|
||||||
|
message.includes('httpcore.') ||
|
||||||
|
message.length > 200
|
||||||
|
) {
|
||||||
|
return fallback;
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
};
|
||||||
|
|
||||||
const LANGUAGE_FLAGS: Record<string, string> = {
|
const LANGUAGE_FLAGS: Record<string, string> = {
|
||||||
'한국어': '🇰🇷',
|
'한국어': '🇰🇷',
|
||||||
'English': '🇺🇸',
|
'English': '🇺🇸',
|
||||||
@@ -39,8 +54,10 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
|||||||
businessInfo,
|
businessInfo,
|
||||||
imageTaskId,
|
imageTaskId,
|
||||||
mId,
|
mId,
|
||||||
|
onStatusChange,
|
||||||
videoGenerationStatus = 'idle',
|
videoGenerationStatus = 'idle',
|
||||||
videoGenerationProgress = 0
|
videoGenerationProgress = 0,
|
||||||
|
onGoToPayment,
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [selectedType, setSelectedType] = useState('보컬');
|
const [selectedType, setSelectedType] = useState('보컬');
|
||||||
@@ -58,11 +75,8 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
|||||||
const [statusMessage, setStatusMessage] = useState('');
|
const [statusMessage, setStatusMessage] = useState('');
|
||||||
const [retryCount, setRetryCount] = useState(0);
|
const [retryCount, setRetryCount] = useState(0);
|
||||||
const [songTaskId, setSongTaskId] = useState<string | null>(null);
|
const [songTaskId, setSongTaskId] = useState<string | null>(null);
|
||||||
const [isLanguageDropdownOpen, setIsLanguageDropdownOpen] = useState(false);
|
|
||||||
|
|
||||||
const progressBarRef = useRef<HTMLDivElement>(null);
|
const progressBarRef = useRef<HTMLDivElement>(null);
|
||||||
const audioRef = useRef<HTMLAudioElement>(null);
|
const audioRef = useRef<HTMLAudioElement>(null);
|
||||||
const languageDropdownRef = useRef<HTMLDivElement>(null);
|
|
||||||
|
|
||||||
// 완료 데이터를 localStorage에 저장
|
// 완료 데이터를 localStorage에 저장
|
||||||
const saveSongCompletionData = () => {
|
const saveSongCompletionData = () => {
|
||||||
@@ -76,22 +90,6 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Close language dropdown when clicking outside
|
// Close language dropdown when clicking outside
|
||||||
useEffect(() => {
|
|
||||||
const handleClickOutside = (event: MouseEvent) => {
|
|
||||||
if (languageDropdownRef.current && !languageDropdownRef.current.contains(event.target as Node)) {
|
|
||||||
setIsLanguageDropdownOpen(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if (isLanguageDropdownOpen) {
|
|
||||||
document.addEventListener('mousedown', handleClickOutside);
|
|
||||||
}
|
|
||||||
|
|
||||||
return () => {
|
|
||||||
document.removeEventListener('mousedown', handleClickOutside);
|
|
||||||
};
|
|
||||||
}, [isLanguageDropdownOpen]);
|
|
||||||
|
|
||||||
// Auto-navigate to next page when video generation is complete
|
// Auto-navigate to next page when video generation is complete
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (videoGenerationStatus === 'complete' && songTaskId) {
|
if (videoGenerationStatus === 'complete' && songTaskId) {
|
||||||
@@ -146,7 +144,10 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setStatus('error');
|
setStatus('error');
|
||||||
setErrorMessage(error instanceof Error ? error.message : t('soundStudio.musicGenerationError'));
|
setErrorMessage(sanitizeError(
|
||||||
|
error instanceof Error ? error.message : '',
|
||||||
|
t('soundStudio.musicGenerationError')
|
||||||
|
));
|
||||||
setRetryCount(0);
|
setRetryCount(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -168,10 +169,10 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
|||||||
'ROCK': 'rock',
|
'ROCK': 'rock',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isInstrumental = selectedType === '배경음악';
|
||||||
const songResponse = await generateSong(imageTaskId, {
|
const songResponse = await generateSong(imageTaskId, {
|
||||||
genre: genreMap[selectedGenre] || 'pop',
|
genre: genreMap[selectedGenre] || 'pop',
|
||||||
language,
|
...(isInstrumental ? { instrumental: true, lyrics: '' } : { language, lyrics: currentLyrics }),
|
||||||
lyrics: currentLyrics,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!songResponse.success) {
|
if (!songResponse.success) {
|
||||||
@@ -183,7 +184,10 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Song regeneration failed:', error);
|
console.error('Song regeneration failed:', error);
|
||||||
setStatus('error');
|
setStatus('error');
|
||||||
setErrorMessage(error instanceof Error ? error.message : t('soundStudio.songRegenerationError'));
|
setErrorMessage(sanitizeError(
|
||||||
|
error instanceof Error ? error.message : '',
|
||||||
|
t('soundStudio.songRegenerationError')
|
||||||
|
));
|
||||||
setRetryCount(0);
|
setRetryCount(0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -286,8 +290,12 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
|||||||
setErrorMessage(null);
|
setErrorMessage(null);
|
||||||
setStatusMessage(t('soundStudio.generatingLyrics'));
|
setStatusMessage(t('soundStudio.generatingLyrics'));
|
||||||
|
|
||||||
|
const savedRatio = localStorage.getItem('castad_video_ratio');
|
||||||
|
const orientation = (savedRatio === 'horizontal' || savedRatio === 'vertical') ? savedRatio : 'vertical';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const language = LANGUAGE_MAP[selectedLang] || 'Korean';
|
const language = LANGUAGE_MAP[selectedLang] || 'Korean';
|
||||||
|
const isInstrumental = selectedType === '배경음악';
|
||||||
|
|
||||||
// 1. 가사 생성 요청
|
// 1. 가사 생성 요청
|
||||||
console.log('[SoundStudio] Sending m_id:', mId);
|
console.log('[SoundStudio] Sending m_id:', mId);
|
||||||
@@ -298,37 +306,14 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
|||||||
m_id: mId,
|
m_id: mId,
|
||||||
region: businessInfo.region,
|
region: businessInfo.region,
|
||||||
task_id: imageTaskId,
|
task_id: imageTaskId,
|
||||||
|
orientation,
|
||||||
|
...(isInstrumental && { instrumental: true }),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!lyricResponse.success || !lyricResponse.task_id) {
|
if (!lyricResponse.success || !lyricResponse.task_id) {
|
||||||
throw new Error(lyricResponse.error_message || t('soundStudio.lyricGenerationFailed'));
|
throw new Error(lyricResponse.error_message || t('soundStudio.lyricGenerationFailed'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. 가사 생성 상태 폴링 → 완료 시 상세 조회
|
|
||||||
setStatusMessage(t('soundStudio.generatingLyrics'));
|
|
||||||
const lyricDetailResponse = await waitForLyricComplete(
|
|
||||||
lyricResponse.task_id,
|
|
||||||
(status: string) => {
|
|
||||||
if (status === 'processing') {
|
|
||||||
setStatusMessage(t('soundStudio.generatingLyrics'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!lyricDetailResponse.lyric_result) {
|
|
||||||
throw new Error(t('soundStudio.lyricNotReceived'));
|
|
||||||
}
|
|
||||||
|
|
||||||
// "I'm sorry" 체크
|
|
||||||
if (lyricDetailResponse.lyric_result.includes("I'm sorry")) {
|
|
||||||
throw new Error(t('soundStudio.lyricGenerationError'));
|
|
||||||
}
|
|
||||||
|
|
||||||
setLyrics(lyricDetailResponse.lyric_result);
|
|
||||||
|
|
||||||
setStatus('generating_song');
|
|
||||||
setStatusMessage(t('soundStudio.generatingSong'));
|
|
||||||
|
|
||||||
const genreMap: Record<string, string> = {
|
const genreMap: Record<string, string> = {
|
||||||
'자동 선택': 'pop',
|
'자동 선택': 'pop',
|
||||||
'K-POP': 'kpop',
|
'K-POP': 'kpop',
|
||||||
@@ -340,10 +325,39 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
|||||||
'ROCK': 'rock',
|
'ROCK': 'rock',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let songLyrics: string | undefined;
|
||||||
|
|
||||||
|
if (!isInstrumental) {
|
||||||
|
// 2. 가사 생성 상태 폴링 → 완료 시 상세 조회
|
||||||
|
setStatusMessage(t('soundStudio.generatingLyrics'));
|
||||||
|
const lyricDetailResponse = await waitForLyricComplete(
|
||||||
|
lyricResponse.task_id,
|
||||||
|
(status: string) => {
|
||||||
|
if (status === 'processing') {
|
||||||
|
setStatusMessage(t('soundStudio.generatingLyrics'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!lyricDetailResponse.lyric_result) {
|
||||||
|
throw new Error(t('soundStudio.lyricNotReceived'));
|
||||||
|
}
|
||||||
|
|
||||||
|
// "I'm sorry" 체크
|
||||||
|
if (lyricDetailResponse.lyric_result.includes("I'm sorry")) {
|
||||||
|
throw new Error(t('soundStudio.lyricGenerationError'));
|
||||||
|
}
|
||||||
|
|
||||||
|
setLyrics(lyricDetailResponse.lyric_result);
|
||||||
|
songLyrics = lyricDetailResponse.lyric_result;
|
||||||
|
}
|
||||||
|
|
||||||
|
setStatus('generating_song');
|
||||||
|
setStatusMessage(t('soundStudio.generatingSong'));
|
||||||
|
|
||||||
const songResponse = await generateSong(imageTaskId, {
|
const songResponse = await generateSong(imageTaskId, {
|
||||||
genre: genreMap[selectedGenre] || 'pop',
|
genre: genreMap[selectedGenre] || 'pop',
|
||||||
language,
|
...(isInstrumental ? { instrumental: true, lyrics: '' } : { language, lyrics: songLyrics }),
|
||||||
lyrics: lyricDetailResponse.lyric_result,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!songResponse.success) {
|
if (!songResponse.success) {
|
||||||
@@ -362,12 +376,15 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
|||||||
setStatus('polling');
|
setStatus('polling');
|
||||||
setStatusMessage(t('soundStudio.generatingSong'));
|
setStatusMessage(t('soundStudio.generatingSong'));
|
||||||
|
|
||||||
await resumePolling(songResponse.task_id, songResponse.song_id, lyricDetailResponse.lyric_result, 0);
|
await resumePolling(songResponse.task_id, songResponse.song_id, songLyrics ?? '', 0);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Music generation failed:', error);
|
console.error('Music generation failed:', error);
|
||||||
setStatus('error');
|
setStatus('error');
|
||||||
setErrorMessage(error instanceof Error ? error.message : t('soundStudio.musicGenerationError'));
|
setErrorMessage(sanitizeError(
|
||||||
|
error instanceof Error ? error.message : '',
|
||||||
|
t('soundStudio.musicGenerationError')
|
||||||
|
));
|
||||||
setRetryCount(0);
|
setRetryCount(0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -385,10 +402,23 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
|||||||
|
|
||||||
const isGenerating = status === 'generating_lyric' || status === 'generating_song' || status === 'polling';
|
const isGenerating = status === 'generating_lyric' || status === 'generating_song' || status === 'polling';
|
||||||
|
|
||||||
|
// status 변경 시 부모에 알림
|
||||||
|
useEffect(() => {
|
||||||
|
onStatusChange?.(status);
|
||||||
|
}, [status]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
<main className="sound-studio-page">
|
<main className="sound-studio-page">
|
||||||
{audioUrl && (
|
{audioUrl && (
|
||||||
<audio ref={audioRef} src={audioUrl} preload="metadata" />
|
<audio
|
||||||
|
ref={audioRef}
|
||||||
|
src={audioUrl}
|
||||||
|
preload="metadata"
|
||||||
|
onLoadedMetadata={() => {
|
||||||
|
if (audioRef.current) setDuration(audioRef.current.duration);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
@@ -416,14 +446,15 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
|||||||
<label className="input-label">{t('soundStudio.soundTypeLabel')}</label>
|
<label className="input-label">{t('soundStudio.soundTypeLabel')}</label>
|
||||||
<div className="sound-type-grid">
|
<div className="sound-type-grid">
|
||||||
{[
|
{[
|
||||||
{ key: '보컬', label: t('soundStudio.soundTypeVocal') },
|
{ key: '보컬', label: t('soundStudio.soundTypeVocal'), disabled: false },
|
||||||
{ key: '배경음악', label: t('soundStudio.soundTypeBGM') },
|
{ key: '배경음악', label: t('soundStudio.soundTypeBGM'), disabled: false },
|
||||||
].map(({ key, label }) => (
|
].map(({ key, label, disabled }) => (
|
||||||
<button
|
<button
|
||||||
key={key}
|
key={key}
|
||||||
onClick={() => !isGenerating && setSelectedType(key)}
|
onClick={() => !isGenerating && !disabled && setSelectedType(key)}
|
||||||
disabled={isGenerating}
|
disabled={isGenerating || disabled}
|
||||||
className={`sound-type-btn ${selectedType === key ? 'active' : ''}`}
|
className={`sound-type-btn ${selectedType === key ? 'active' : ''}`}
|
||||||
|
title={disabled ? t('soundStudio.comingSoon', { defaultValue: '이후 오픈 예정입니다' }) : undefined}
|
||||||
>
|
>
|
||||||
{label}
|
{label}
|
||||||
</button>
|
</button>
|
||||||
@@ -482,39 +513,31 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
|||||||
{/* Language Selection */}
|
{/* Language Selection */}
|
||||||
<div className="sound-studio-section">
|
<div className="sound-studio-section">
|
||||||
<label className="input-label">{t('soundStudio.languageLabel')}</label>
|
<label className="input-label">{t('soundStudio.languageLabel')}</label>
|
||||||
<div className="language-selector-wrapper" ref={languageDropdownRef}>
|
<div className="genre-grid language-grid">
|
||||||
<button
|
<div className="genre-row">
|
||||||
onClick={() => setIsLanguageDropdownOpen(!isLanguageDropdownOpen)}
|
{['한국어', 'English', '中文'].map((lang) => (
|
||||||
disabled={isGenerating}
|
<button
|
||||||
className="language-selector"
|
key={lang}
|
||||||
>
|
onClick={() => !isGenerating && setSelectedLang(lang)}
|
||||||
<div className="language-display">
|
disabled={isGenerating}
|
||||||
<span className="language-flag">{LANGUAGE_FLAGS[selectedLang]}</span>
|
className={`genre-btn ${selectedLang === lang ? 'active' : ''}`}
|
||||||
<span className="language-name">{selectedLang}</span>
|
>
|
||||||
</div>
|
<span>{LANGUAGE_FLAGS[lang]}</span> {lang}
|
||||||
<img
|
</button>
|
||||||
src="/assets/images/icon-dropdown.svg"
|
))}
|
||||||
alt=""
|
</div>
|
||||||
className={`language-dropdown-icon ${isLanguageDropdownOpen ? 'open' : ''}`}
|
<div className="genre-row">
|
||||||
/>
|
{['日本語', 'ไทย', 'Tiếng Việt'].map((lang) => (
|
||||||
</button>
|
<button
|
||||||
{isLanguageDropdownOpen && (
|
key={lang}
|
||||||
<div className="language-dropdown-menu">
|
onClick={() => !isGenerating && setSelectedLang(lang)}
|
||||||
{Object.keys(LANGUAGE_MAP).map((lang) => (
|
disabled={isGenerating}
|
||||||
<button
|
className={`genre-btn ${selectedLang === lang ? 'active' : ''}`}
|
||||||
key={lang}
|
>
|
||||||
onClick={() => {
|
<span>{LANGUAGE_FLAGS[lang]}</span> {lang}
|
||||||
setSelectedLang(lang);
|
</button>
|
||||||
setIsLanguageDropdownOpen(false);
|
))}
|
||||||
}}
|
</div>
|
||||||
className={`language-dropdown-item ${selectedLang === lang ? 'active' : ''}`}
|
|
||||||
>
|
|
||||||
<span className="language-flag">{LANGUAGE_FLAGS[lang]}</span>
|
|
||||||
<span className="language-name">{lang}</span>
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -527,6 +550,16 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
|||||||
</svg>
|
</svg>
|
||||||
{statusMessage}
|
{statusMessage}
|
||||||
</div>
|
</div>
|
||||||
|
) : status === 'complete' ? (
|
||||||
|
<>
|
||||||
|
<button
|
||||||
|
onClick={handleRegenerate}
|
||||||
|
className="btn-generate-sound"
|
||||||
|
>
|
||||||
|
{t('soundStudio.regenerateButton')}
|
||||||
|
</button>
|
||||||
|
<p className="regenerate-hint">{t('soundStudio.regenerateHint')}</p>
|
||||||
|
</>
|
||||||
) : (
|
) : (
|
||||||
<button
|
<button
|
||||||
onClick={handleGenerateMusic}
|
onClick={handleGenerateMusic}
|
||||||
@@ -537,18 +570,30 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
|||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{errorMessage && (
|
{errorMessage && (() => {
|
||||||
<div className="error-message-new">
|
const isCreditsError = errorMessage.includes('credit');
|
||||||
{errorMessage}
|
return (
|
||||||
</div>
|
<div className="error-message-new">
|
||||||
)}
|
{isCreditsError ? t('soundStudio.creditsExhausted') : errorMessage}
|
||||||
|
{isCreditsError && (
|
||||||
|
<a
|
||||||
|
href=""
|
||||||
|
className="charge-credits-link"
|
||||||
|
onClick={e => { e.preventDefault(); onGoToPayment?.(); }}
|
||||||
|
>
|
||||||
|
{t('soundStudio.chargeCredits')}
|
||||||
|
</a>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})()}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Right Column - Lyrics */}
|
{/* Right Column - Lyrics */}
|
||||||
<div className="lyrics-column">
|
<div className="lyrics-column">
|
||||||
<div className="lyrics-header">
|
<div className="lyrics-header">
|
||||||
<h3 className="column-title">{t('soundStudio.lyricsColumn')}</h3>
|
<h3 className="column-title">{t('soundStudio.lyricsColumn')}</h3>
|
||||||
<p className="lyrics-subtitle">{t('soundStudio.lyricsHint')}</p>
|
{/* <p className="lyrics-subtitle">{t('soundStudio.lyricsHint')}</p> */}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Audio Player */}
|
{/* Audio Player */}
|
||||||
@@ -588,16 +633,29 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
|||||||
|
|
||||||
{/* Lyrics Display */}
|
{/* Lyrics Display */}
|
||||||
<div className="lyrics-display">
|
<div className="lyrics-display">
|
||||||
{lyrics ? (
|
{lyrics ? (() => {
|
||||||
<textarea
|
const lines = lyrics.split('\n').filter(l => l.trim());
|
||||||
value={lyrics}
|
const outro = lines.slice(-1);
|
||||||
onChange={(e) => setLyrics(e.target.value)}
|
const body = lines.slice(0, -1);
|
||||||
className="lyrics-textarea"
|
const half = Math.ceil(body.length / 2);
|
||||||
placeholder={t('soundStudio.lyricsPlaceholder')}
|
const sections = [
|
||||||
/>
|
{ tag: '[Verse]', lines: body.slice(0, half) },
|
||||||
) : (
|
{ tag: '[Chorus]', lines: body.slice(half) },
|
||||||
|
{ tag: '[Outro]', lines: outro },
|
||||||
|
].filter(s => s.lines.length > 0);
|
||||||
|
return (
|
||||||
|
<div className="lyrics-paragraphs">
|
||||||
|
{sections.map((section, i) => (
|
||||||
|
<div key={i} className="lyrics-section">
|
||||||
|
<span className="lyrics-tag">{section.tag}</span>
|
||||||
|
<p className="lyrics-paragraph">{section.lines.join('\n')}</p>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})() : (
|
||||||
<div className="lyrics-placeholder">
|
<div className="lyrics-placeholder">
|
||||||
{t('soundStudio.lyricsPlaceholder')}
|
{selectedType === '배경음악' ? t('soundStudio.lyricsPlaceholderBGM') : t('soundStudio.lyricsPlaceholder')}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -639,6 +697,8 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
|
import React, { useState } from 'react';
|
||||||
import React, { useState, useRef, useCallback } from 'react';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { searchAccommodation, AccommodationSearchItem, AutocompleteRequest } from '../../utils/api';
|
import { AutocompleteRequest } from '../../utils/api';
|
||||||
import { CrawlingResponse } from '../../types/api';
|
import { CrawlingResponse } from '../../types/api';
|
||||||
|
import SearchInputForm, { SearchType } from '../../components/SearchInputForm';
|
||||||
type SearchType = 'url' | 'name';
|
|
||||||
|
|
||||||
// 환경변수에서 테스트 모드 확인
|
// 환경변수에서 테스트 모드 확인
|
||||||
const isTestPage = import.meta.env.VITE_IS_TESTPAGE === 'true';
|
const isTestPage = import.meta.env.VITE_IS_TESTPAGE === 'true';
|
||||||
@@ -12,22 +10,15 @@ const isTestPage = import.meta.env.VITE_IS_TESTPAGE === 'true';
|
|||||||
interface UrlInputContentProps {
|
interface UrlInputContentProps {
|
||||||
onAnalyze: (value: string, type?: SearchType) => void;
|
onAnalyze: (value: string, type?: SearchType) => void;
|
||||||
onAutocomplete?: (data: AutocompleteRequest) => void;
|
onAutocomplete?: (data: AutocompleteRequest) => void;
|
||||||
|
onManualInput?: (businessName: string, address: string) => void;
|
||||||
onTestData?: (data: CrawlingResponse) => void;
|
onTestData?: (data: CrawlingResponse) => void;
|
||||||
error: string | null;
|
error: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomplete, onTestData, error }) => {
|
const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomplete, onManualInput, onTestData, error }) => {
|
||||||
const { t, i18n } = useTranslation();
|
const { t, i18n } = useTranslation();
|
||||||
const [inputValue, setInputValue] = useState('');
|
|
||||||
const [searchType, setSearchType] = useState<SearchType>('url');
|
|
||||||
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
|
||||||
const [autocompleteResults, setAutocompleteResults] = useState<AccommodationSearchItem[]>([]);
|
|
||||||
const [isAutocompleteLoading, setIsAutocompleteLoading] = useState(false);
|
|
||||||
const [showAutocomplete, setShowAutocomplete] = useState(false);
|
|
||||||
const [selectedItem, setSelectedItem] = useState<AccommodationSearchItem | null>(null);
|
|
||||||
const [isLoadingTest, setIsLoadingTest] = useState(false);
|
const [isLoadingTest, setIsLoadingTest] = useState(false);
|
||||||
|
|
||||||
// 테스트 데이터 로드 핸들러
|
|
||||||
const handleTestData = async () => {
|
const handleTestData = async () => {
|
||||||
if (!onTestData) return;
|
if (!onTestData) return;
|
||||||
setIsLoadingTest(true);
|
setIsLoadingTest(true);
|
||||||
@@ -42,225 +33,21 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomp
|
|||||||
setIsLoadingTest(false);
|
setIsLoadingTest(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const [highlightedIndex, setHighlightedIndex] = useState<number>(-1);
|
|
||||||
const debounceRef = useRef<NodeJS.Timeout | null>(null);
|
|
||||||
const autocompleteRef = useRef<HTMLDivElement>(null);
|
|
||||||
|
|
||||||
const searchTypeOptions = [
|
|
||||||
{ value: 'url' as SearchType, label: 'URL' },
|
|
||||||
{ value: 'name' as SearchType, label: t('urlInput.searchTypeBusinessName') },
|
|
||||||
];
|
|
||||||
|
|
||||||
const getPlaceholder = () => {
|
|
||||||
return searchType === 'url'
|
|
||||||
? 'https://www.castad.com'
|
|
||||||
: t('urlInput.placeholderBusinessName');
|
|
||||||
};
|
|
||||||
|
|
||||||
const getGuideText = () => {
|
|
||||||
return searchType === 'url'
|
|
||||||
? t('urlInput.guideUrl')
|
|
||||||
: t('urlInput.guideBusinessName');
|
|
||||||
};
|
|
||||||
|
|
||||||
// 업체명 검색 시 자동완성 (디바운스 적용)
|
|
||||||
const handleAutocompleteSearch = useCallback(async (query: string) => {
|
|
||||||
if (!query.trim() || searchType !== 'name') {
|
|
||||||
setAutocompleteResults([]);
|
|
||||||
setShowAutocomplete(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
setIsAutocompleteLoading(true);
|
|
||||||
try {
|
|
||||||
const response = await searchAccommodation(query);
|
|
||||||
setAutocompleteResults(response.items || []);
|
|
||||||
setShowAutocomplete(response.items && response.items.length > 0);
|
|
||||||
} catch (error) {
|
|
||||||
console.error('자동완성 검색 오류:', error);
|
|
||||||
setAutocompleteResults([]);
|
|
||||||
setShowAutocomplete(false);
|
|
||||||
} finally {
|
|
||||||
setIsAutocompleteLoading(false);
|
|
||||||
}
|
|
||||||
}, [searchType]);
|
|
||||||
|
|
||||||
// 자동완성 항목 선택 - 업체 정보 저장
|
|
||||||
const handleSelectAutocomplete = (item: AccommodationSearchItem) => {
|
|
||||||
setInputValue(item.title.replace(/<[^>]*>/g, '')); // HTML 태그 제거
|
|
||||||
setSelectedItem(item); // 선택된 업체 정보 저장
|
|
||||||
setShowAutocomplete(false);
|
|
||||||
setAutocompleteResults([]);
|
|
||||||
setHighlightedIndex(-1);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 키보드 네비게이션 핸들러
|
|
||||||
const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
|
||||||
if (!showAutocomplete || autocompleteResults.length === 0) return;
|
|
||||||
|
|
||||||
switch (e.key) {
|
|
||||||
case 'ArrowDown':
|
|
||||||
e.preventDefault();
|
|
||||||
setHighlightedIndex(prev =>
|
|
||||||
prev < autocompleteResults.length - 1 ? prev + 1 : 0
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case 'ArrowUp':
|
|
||||||
e.preventDefault();
|
|
||||||
setHighlightedIndex(prev =>
|
|
||||||
prev > 0 ? prev - 1 : autocompleteResults.length - 1
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case 'Enter':
|
|
||||||
if (highlightedIndex >= 0 && highlightedIndex < autocompleteResults.length) {
|
|
||||||
e.preventDefault();
|
|
||||||
handleSelectAutocomplete(autocompleteResults[highlightedIndex]);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'Escape':
|
|
||||||
setShowAutocomplete(false);
|
|
||||||
setHighlightedIndex(-1);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 폼 제출 처리
|
|
||||||
const handleSubmit = (e: React.FormEvent) => {
|
|
||||||
e.preventDefault();
|
|
||||||
if (!inputValue.trim()) return;
|
|
||||||
|
|
||||||
if (searchType === 'name' && selectedItem && onAutocomplete) {
|
|
||||||
// 업체명 검색인 경우 autocomplete API 호출
|
|
||||||
const request: AutocompleteRequest = {
|
|
||||||
address: selectedItem.address,
|
|
||||||
roadAddress: selectedItem.roadAddress,
|
|
||||||
title: selectedItem.title,
|
|
||||||
};
|
|
||||||
onAutocomplete(request);
|
|
||||||
} else {
|
|
||||||
// URL 검색인 경우 기존 로직
|
|
||||||
onAnalyze(inputValue.trim(), searchType);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="url-input-container">
|
<div className="url-input-container">
|
||||||
<div className="url-input-content">
|
<div className="url-input-content">
|
||||||
{/* 로고 */}
|
{/* 로고 */}
|
||||||
<div className="url-input-logo">
|
<div className="url-input-logo">
|
||||||
<img src="/assets/images/ado2-logo.svg" alt="ADO2" />
|
<img src="/assets/images/ADO2_with Slogan_white.svg" alt="ADO2" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* URL 입력 폼 */}
|
<SearchInputForm
|
||||||
<form onSubmit={handleSubmit} className="url-input-form">
|
onAnalyze={onAnalyze}
|
||||||
<div className="url-input-wrapper">
|
onAutocomplete={onAutocomplete}
|
||||||
{/* 드롭다운 */}
|
onManualInput={onManualInput}
|
||||||
<div className="url-input-dropdown-container">
|
error={error}
|
||||||
<button
|
/>
|
||||||
type="button"
|
|
||||||
className="url-input-dropdown-trigger"
|
|
||||||
onClick={() => setIsDropdownOpen(!isDropdownOpen)}
|
|
||||||
>
|
|
||||||
<span>{searchTypeOptions.find(opt => opt.value === searchType)?.label}</span>
|
|
||||||
<svg
|
|
||||||
width="12"
|
|
||||||
height="12"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
strokeWidth="2"
|
|
||||||
className={`url-input-dropdown-arrow ${isDropdownOpen ? 'open' : ''}`}
|
|
||||||
>
|
|
||||||
<path d="M6 9l6 6 6-6" />
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
{isDropdownOpen && (
|
|
||||||
<div className="url-input-dropdown-menu">
|
|
||||||
{searchTypeOptions.map((option) => (
|
|
||||||
<button
|
|
||||||
key={option.value}
|
|
||||||
type="button"
|
|
||||||
className={`url-input-dropdown-item ${searchType === option.value ? 'active' : ''}`}
|
|
||||||
onClick={() => {
|
|
||||||
setSearchType(option.value);
|
|
||||||
setIsDropdownOpen(false);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{option.label}
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* 입력 필드 */}
|
|
||||||
<div className="url-input-field-container" ref={autocompleteRef}>
|
|
||||||
<input
|
|
||||||
type={searchType === 'url' ? 'url' : 'text'}
|
|
||||||
value={inputValue}
|
|
||||||
onChange={(e) => {
|
|
||||||
const value = e.target.value;
|
|
||||||
setInputValue(value);
|
|
||||||
|
|
||||||
// 업체명 검색일 때 자동완성 검색 (디바운스)
|
|
||||||
if (searchType === 'name') {
|
|
||||||
if (debounceRef.current) {
|
|
||||||
clearTimeout(debounceRef.current);
|
|
||||||
}
|
|
||||||
debounceRef.current = setTimeout(() => {
|
|
||||||
handleAutocompleteSearch(value);
|
|
||||||
}, 300);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onFocus={() => {
|
|
||||||
if (searchType === 'name' && autocompleteResults.length > 0) {
|
|
||||||
setShowAutocomplete(true);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
placeholder={getPlaceholder()}
|
|
||||||
className="url-input-field"
|
|
||||||
/>
|
|
||||||
|
|
||||||
{/* 자동완성 결과 */}
|
|
||||||
{showAutocomplete && searchType === 'name' && (
|
|
||||||
<div className="url-input-autocomplete-dropdown">
|
|
||||||
{isAutocompleteLoading ? (
|
|
||||||
<div className="url-input-autocomplete-loading">{t('urlInput.searching')}</div>
|
|
||||||
) : (
|
|
||||||
autocompleteResults.map((item, index) => (
|
|
||||||
<button
|
|
||||||
key={index}
|
|
||||||
type="button"
|
|
||||||
className="url-input-autocomplete-item"
|
|
||||||
onMouseDown={(e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
handleSelectAutocomplete(item);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div className="url-input-autocomplete-title" dangerouslySetInnerHTML={{ __html: item.title }} />
|
|
||||||
<div className="url-input-autocomplete-address">{item.roadAddress || item.address}</div>
|
|
||||||
</button>
|
|
||||||
))
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* 검색 버튼 */}
|
|
||||||
<button type="submit" className="url-input-button">
|
|
||||||
{t('landing.hero.analyzeButton')}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
{/* 에러 메시지 */}
|
|
||||||
{error && (
|
|
||||||
<p className="url-input-error">{error}</p>
|
|
||||||
)}
|
|
||||||
</form>
|
|
||||||
|
|
||||||
{/* 안내 텍스트 */}
|
|
||||||
<p className="url-input-guide">
|
|
||||||
{getGuideText()}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 테스트 버튼 (VITE_IS_TESTPAGE=true일 때만 표시) */}
|
{/* 테스트 버튼 (VITE_IS_TESTPAGE=true일 때만 표시) */}
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ const DisplaySection: React.FC<DisplaySectionProps> = ({ onStartClick }) => {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
// YouTube Shorts 영상 ID들
|
// YouTube Shorts 영상 ID들
|
||||||
const videos = [
|
const videos = [
|
||||||
{ id: 1, videoId: 'OZJ8X4P82OA' },
|
{ id: 1, videoId: 'trnN0SQBTiI' },
|
||||||
{ id: 2, videoId: 'hNzMO21O40c' },
|
{ id: 2, videoId: '96HO497HsQI' },
|
||||||
{ id: 3, videoId: 'dM8_d6Aud68' },
|
{ id: 3, videoId: 'XziImxVICIk' },
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,32 +1,19 @@
|
|||||||
|
|
||||||
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
import React, { useState, useEffect, useRef } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { searchAccommodation, AccommodationSearchItem, AutocompleteRequest } from '../../utils/api';
|
import { AutocompleteRequest, isLoggedIn } from '../../utils/api';
|
||||||
import { CrawlingResponse } from '../../types/api';
|
import { CrawlingResponse } from '../../types/api';
|
||||||
|
import { useTutorial } from '../../components/Tutorial/useTutorial';
|
||||||
type SearchType = 'url' | 'name';
|
import { TUTORIAL_KEYS } from '../../components/Tutorial/tutorialSteps';
|
||||||
|
import TutorialOverlay from '../../components/Tutorial/TutorialOverlay';
|
||||||
|
import BusinessNameInputModal from '../../components/BusinessNameInputModal';
|
||||||
|
import LoginPromptModal from '../../components/LoginPromptModal';
|
||||||
|
import SearchInputForm from '../../components/SearchInputForm';
|
||||||
|
import { SearchType } from '../../components/SearchInputForm';
|
||||||
|
|
||||||
// 환경변수에서 테스트 모드 확인
|
// 환경변수에서 테스트 모드 확인
|
||||||
const isTestPage = import.meta.env.VITE_IS_TESTPAGE === 'true';
|
const isTestPage = import.meta.env.VITE_IS_TESTPAGE === 'true';
|
||||||
|
|
||||||
interface HeroSectionProps {
|
|
||||||
onAnalyze?: (value: string, type?: SearchType) => void;
|
|
||||||
onAutocomplete?: (data: AutocompleteRequest) => void;
|
|
||||||
onTestData?: (data: CrawlingResponse) => void;
|
|
||||||
onNext?: () => void;
|
|
||||||
error?: string | null;
|
|
||||||
scrollProgress?: number; // 0 ~ 1 (스크롤 진행률)
|
|
||||||
}
|
|
||||||
|
|
||||||
const isValidUrl = (string: string): boolean => {
|
|
||||||
try {
|
|
||||||
const url = new URL(string);
|
|
||||||
return url.protocol === 'http:' || url.protocol === 'https:';
|
|
||||||
} catch {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Orb configuration with movement zones to prevent overlap
|
// Orb configuration with movement zones to prevent overlap
|
||||||
interface OrbConfig {
|
interface OrbConfig {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -34,36 +21,50 @@ interface OrbConfig {
|
|||||||
initialX: number;
|
initialX: number;
|
||||||
initialY: number;
|
initialY: number;
|
||||||
color: string;
|
color: string;
|
||||||
// Movement bounds for each orb
|
|
||||||
minX: number;
|
minX: number;
|
||||||
maxX: number;
|
maxX: number;
|
||||||
minY: number;
|
minY: number;
|
||||||
maxY: number;
|
maxY: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 6 orbs distributed in a 3x2 grid pattern with overlapping zones for smooth movement
|
|
||||||
const orbConfigs: OrbConfig[] = [
|
const orbConfigs: OrbConfig[] = [
|
||||||
// Top-left zone
|
|
||||||
{ id: 'orb-1', size: 500, initialX: -10, initialY: -10, color: 'radial-gradient(circle, #C490FF 20%, #AE72F9 50%, rgba(94, 235, 195, 0.4) 100%)', minX: -30, maxX: 35, minY: -30, maxY: 40 },
|
{ id: 'orb-1', size: 500, initialX: -10, initialY: -10, color: 'radial-gradient(circle, #C490FF 20%, #AE72F9 50%, rgba(94, 235, 195, 0.4) 100%)', minX: -30, maxX: 35, minY: -30, maxY: 40 },
|
||||||
// Top-right zone
|
|
||||||
{ id: 'orb-2', size: 480, initialX: 70, initialY: -5, color: 'radial-gradient(circle, #5EEBC3 25%, rgba(174, 114, 249, 0.6) 70%, rgba(139, 92, 246, 0.3) 100%)', minX: 50, maxX: 110, minY: -30, maxY: 40 },
|
{ id: 'orb-2', size: 480, initialX: 70, initialY: -5, color: 'radial-gradient(circle, #5EEBC3 25%, rgba(174, 114, 249, 0.6) 70%, rgba(139, 92, 246, 0.3) 100%)', minX: 50, maxX: 110, minY: -30, maxY: 40 },
|
||||||
// Middle-left zone
|
|
||||||
{ id: 'orb-3', size: 420, initialX: 5, initialY: 35, color: 'radial-gradient(circle, rgba(148, 251, 224, 0.8) 15%, #AE72F9 55%, rgba(94, 235, 195, 0.3) 100%)', minX: -20, maxX: 45, minY: 20, maxY: 65 },
|
{ id: 'orb-3', size: 420, initialX: 5, initialY: 35, color: 'radial-gradient(circle, rgba(148, 251, 224, 0.8) 15%, #AE72F9 55%, rgba(94, 235, 195, 0.3) 100%)', minX: -20, maxX: 45, minY: 20, maxY: 65 },
|
||||||
// Middle-right zone
|
|
||||||
{ id: 'orb-4', size: 400, initialX: 60, initialY: 40, color: 'radial-gradient(circle, rgba(220, 200, 255, 0.95) 10%, rgba(148, 251, 224, 0.85) 45%, rgba(174, 114, 249, 0.5) 100%)', minX: 40, maxX: 100, minY: 25, maxY: 70 },
|
{ id: 'orb-4', size: 400, initialX: 60, initialY: 40, color: 'radial-gradient(circle, rgba(220, 200, 255, 0.95) 10%, rgba(148, 251, 224, 0.85) 45%, rgba(174, 114, 249, 0.5) 100%)', minX: 40, maxX: 100, minY: 25, maxY: 70 },
|
||||||
// Bottom-left zone
|
|
||||||
{ id: 'orb-5', size: 520, initialX: -8, initialY: 65, color: 'radial-gradient(circle, #B794F6 30%, rgba(148, 251, 224, 0.6) 65%, rgba(174, 114, 249, 0.3) 100%)', minX: -30, maxX: 40, minY: 50, maxY: 110 },
|
{ id: 'orb-5', size: 520, initialX: -8, initialY: 65, color: 'radial-gradient(circle, #B794F6 30%, rgba(148, 251, 224, 0.6) 65%, rgba(174, 114, 249, 0.3) 100%)', minX: -30, maxX: 40, minY: 50, maxY: 110 },
|
||||||
// Bottom-right zone
|
|
||||||
{ id: 'orb-6', size: 450, initialX: 65, initialY: 70, color: 'radial-gradient(circle, rgba(180, 255, 235, 0.95) 15%, rgba(200, 160, 255, 0.8) 50%, rgba(94, 235, 195, 0.45) 100%)', minX: 45, maxX: 110, minY: 55, maxY: 110 },
|
{ id: 'orb-6', size: 450, initialX: 65, initialY: 70, color: 'radial-gradient(circle, rgba(180, 255, 235, 0.95) 15%, rgba(200, 160, 255, 0.8) 50%, rgba(94, 235, 195, 0.45) 100%)', minX: 45, maxX: 110, minY: 55, maxY: 110 },
|
||||||
];
|
];
|
||||||
|
|
||||||
const HeroSection: React.FC<HeroSectionProps> = ({ onAnalyze, onAutocomplete, onTestData, onNext, error: externalError, scrollProgress = 0 }) => {
|
interface HeroSectionProps {
|
||||||
|
onAnalyze?: (value: string, type?: SearchType) => void;
|
||||||
|
onAutocomplete?: (data: AutocompleteRequest) => void;
|
||||||
|
onManualInput?: (businessName: string, address: string) => void;
|
||||||
|
onTestData?: (data: CrawlingResponse) => void;
|
||||||
|
onNext?: () => void;
|
||||||
|
error?: string | null;
|
||||||
|
scrollProgress?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
const HeroSection: React.FC<HeroSectionProps> = ({ onAnalyze, onAutocomplete, onManualInput, onTestData, onNext, error: externalError, scrollProgress = 0 }) => {
|
||||||
const { t, i18n } = useTranslation();
|
const { t, i18n } = useTranslation();
|
||||||
const [inputValue, setInputValue] = useState('');
|
const [isManualModalOpen, setIsManualModalOpen] = useState(false);
|
||||||
const [searchType, setSearchType] = useState<SearchType>('url');
|
const [isLoginPromptOpen, setIsLoginPromptOpen] = useState(false);
|
||||||
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
const [testError, setTestError] = useState('');
|
||||||
const [localError, setLocalError] = useState('');
|
|
||||||
const [isLoadingTest, setIsLoadingTest] = useState(false);
|
const [isLoadingTest, setIsLoadingTest] = useState(false);
|
||||||
|
const orbRefs = useRef<(HTMLDivElement | null)[]>([]);
|
||||||
|
const animationRefs = useRef<number[]>([]);
|
||||||
|
const tutorial = useTutorial();
|
||||||
|
|
||||||
|
// 첫 방문 시 랜딩 튜토리얼 시작
|
||||||
|
useEffect(() => {
|
||||||
|
if (!tutorial.hasSeen(TUTORIAL_KEYS.LANDING)) {
|
||||||
|
const timer = setTimeout(() => {
|
||||||
|
tutorial.startTutorial(TUTORIAL_KEYS.LANDING);
|
||||||
|
}, 800);
|
||||||
|
return () => clearTimeout(timer);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
// 테스트 데이터 로드 핸들러
|
// 테스트 데이터 로드 핸들러
|
||||||
const handleTestData = async () => {
|
const handleTestData = async () => {
|
||||||
@@ -74,119 +75,19 @@ const HeroSection: React.FC<HeroSectionProps> = ({ onAnalyze, onAutocomplete, on
|
|||||||
const response = await fetch(jsonFile);
|
const response = await fetch(jsonFile);
|
||||||
const data: CrawlingResponse = await response.json();
|
const data: CrawlingResponse = await response.json();
|
||||||
onTestData(data);
|
onTestData(data);
|
||||||
} catch (error) {
|
} catch {
|
||||||
console.error('테스트 데이터 로드 실패:', error);
|
setTestError(t('landing.hero.testDataLoadFailed'));
|
||||||
setLocalError(t('landing.hero.testDataLoadFailed'));
|
|
||||||
} finally {
|
} finally {
|
||||||
setIsLoadingTest(false);
|
setIsLoadingTest(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const [isFocused, setIsFocused] = useState(false);
|
|
||||||
const [autocompleteResults, setAutocompleteResults] = useState<AccommodationSearchItem[]>([]);
|
|
||||||
const [isAutocompleteLoading, setIsAutocompleteLoading] = useState(false);
|
|
||||||
const [showAutocomplete, setShowAutocomplete] = useState(false);
|
|
||||||
const [selectedItem, setSelectedItem] = useState<AccommodationSearchItem | null>(null);
|
|
||||||
const [highlightedIndex, setHighlightedIndex] = useState<number>(-1);
|
|
||||||
const orbRefs = useRef<(HTMLDivElement | null)[]>([]);
|
|
||||||
const animationRefs = useRef<number[]>([]);
|
|
||||||
const dropdownRef = useRef<HTMLDivElement>(null);
|
|
||||||
const autocompleteRef = useRef<HTMLDivElement>(null);
|
|
||||||
const debounceRef = useRef<NodeJS.Timeout | null>(null);
|
|
||||||
|
|
||||||
const searchTypeOptions = [
|
// Orb 랜덤 이동 애니메이션
|
||||||
{ value: 'url' as SearchType, label: 'URL' },
|
|
||||||
{ value: 'name' as SearchType, label: t('landing.hero.searchTypeBusinessName') },
|
|
||||||
];
|
|
||||||
|
|
||||||
// 드롭다운 외부 클릭 감지
|
|
||||||
useEffect(() => {
|
|
||||||
const handleClickOutside = (event: MouseEvent) => {
|
|
||||||
if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) {
|
|
||||||
setIsDropdownOpen(false);
|
|
||||||
}
|
|
||||||
if (autocompleteRef.current && !autocompleteRef.current.contains(event.target as Node)) {
|
|
||||||
setShowAutocomplete(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
document.addEventListener('mousedown', handleClickOutside);
|
|
||||||
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
// 업체명 검색 시 자동완성 (디바운스 적용)
|
|
||||||
const handleAutocompleteSearch = useCallback(async (query: string) => {
|
|
||||||
if (!query.trim() || searchType !== 'name') {
|
|
||||||
setAutocompleteResults([]);
|
|
||||||
setShowAutocomplete(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
setIsAutocompleteLoading(true);
|
|
||||||
try {
|
|
||||||
const response = await searchAccommodation(query);
|
|
||||||
setAutocompleteResults(response.items || []);
|
|
||||||
setShowAutocomplete(response.items && response.items.length > 0);
|
|
||||||
} catch (error) {
|
|
||||||
console.error('자동완성 검색 오류:', error);
|
|
||||||
setAutocompleteResults([]);
|
|
||||||
setShowAutocomplete(false);
|
|
||||||
} finally {
|
|
||||||
setIsAutocompleteLoading(false);
|
|
||||||
}
|
|
||||||
}, [searchType]);
|
|
||||||
|
|
||||||
// 자동완성 항목 선택 - 업체 정보 저장
|
|
||||||
const handleSelectAutocomplete = (item: AccommodationSearchItem) => {
|
|
||||||
setInputValue(item.title.replace(/<[^>]*>/g, '')); // HTML 태그 제거
|
|
||||||
setSelectedItem(item); // 선택된 업체 정보 저장
|
|
||||||
setShowAutocomplete(false);
|
|
||||||
setAutocompleteResults([]);
|
|
||||||
setHighlightedIndex(-1);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 키보드 네비게이션 핸들러
|
|
||||||
const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
|
||||||
// 자동완성이 표시될 때만 키보드 네비게이션 활성화
|
|
||||||
if (showAutocomplete && autocompleteResults.length > 0) {
|
|
||||||
switch (e.key) {
|
|
||||||
case 'ArrowDown':
|
|
||||||
e.preventDefault();
|
|
||||||
setHighlightedIndex(prev =>
|
|
||||||
prev < autocompleteResults.length - 1 ? prev + 1 : 0
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
case 'ArrowUp':
|
|
||||||
e.preventDefault();
|
|
||||||
setHighlightedIndex(prev =>
|
|
||||||
prev > 0 ? prev - 1 : autocompleteResults.length - 1
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
case 'Enter':
|
|
||||||
e.preventDefault(); // 항상 Enter 기본 동작 방지
|
|
||||||
if (highlightedIndex >= 0 && highlightedIndex < autocompleteResults.length) {
|
|
||||||
handleSelectAutocomplete(autocompleteResults[highlightedIndex]);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
case 'Escape':
|
|
||||||
e.preventDefault();
|
|
||||||
setShowAutocomplete(false);
|
|
||||||
setHighlightedIndex(-1);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 업체명 검색 모드에서 Enter 키 입력 시 기본 동작 방지 (폼 제출 방지)
|
|
||||||
if (e.key === 'Enter' && searchType === 'name') {
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Random movement for orbs
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const moveOrb = (orb: HTMLDivElement, index: number) => {
|
const moveOrb = (orb: HTMLDivElement, index: number) => {
|
||||||
const config = orbConfigs[index];
|
const config = orbConfigs[index];
|
||||||
let currentX = config.initialX;
|
let currentX = config.initialX;
|
||||||
let currentY = config.initialY;
|
let currentY = config.initialY;
|
||||||
// 초기 타겟은 현재 위치와 동일하게 설정 (순간이동 방지)
|
|
||||||
let targetX = currentX;
|
let targetX = currentX;
|
||||||
let targetY = currentY;
|
let targetY = currentY;
|
||||||
let scale = 1;
|
let scale = 1;
|
||||||
@@ -194,17 +95,13 @@ const HeroSection: React.FC<HeroSectionProps> = ({ onAnalyze, onAutocomplete, on
|
|||||||
let isFirstMove = true;
|
let isFirstMove = true;
|
||||||
|
|
||||||
const generateNewTarget = () => {
|
const generateNewTarget = () => {
|
||||||
// Move within the orb's designated zone
|
|
||||||
const rangeX = config.maxX - config.minX;
|
const rangeX = config.maxX - config.minX;
|
||||||
const rangeY = config.maxY - config.minY;
|
const rangeY = config.maxY - config.minY;
|
||||||
|
|
||||||
if (isFirstMove) {
|
if (isFirstMove) {
|
||||||
// 첫 이동은 현재 위치에서 가까운 곳으로 (자연스러운 시작)
|
|
||||||
const smallRangeX = rangeX * 0.3;
|
const smallRangeX = rangeX * 0.3;
|
||||||
const smallRangeY = rangeY * 0.3;
|
const smallRangeY = rangeY * 0.3;
|
||||||
targetX = currentX + (Math.random() - 0.5) * smallRangeX;
|
targetX = currentX + (Math.random() - 0.5) * smallRangeX;
|
||||||
targetY = currentY + (Math.random() - 0.5) * smallRangeY;
|
targetY = currentY + (Math.random() - 0.5) * smallRangeY;
|
||||||
// 범위 내로 클램핑
|
|
||||||
targetX = Math.max(config.minX, Math.min(config.maxX, targetX));
|
targetX = Math.max(config.minX, Math.min(config.maxX, targetX));
|
||||||
targetY = Math.max(config.minY, Math.min(config.maxY, targetY));
|
targetY = Math.max(config.minY, Math.min(config.maxY, targetY));
|
||||||
isFirstMove = false;
|
isFirstMove = false;
|
||||||
@@ -212,94 +109,38 @@ const HeroSection: React.FC<HeroSectionProps> = ({ onAnalyze, onAutocomplete, on
|
|||||||
targetX = config.minX + Math.random() * rangeX;
|
targetX = config.minX + Math.random() * rangeX;
|
||||||
targetY = config.minY + Math.random() * rangeY;
|
targetY = config.minY + Math.random() * rangeY;
|
||||||
}
|
}
|
||||||
targetScale = 0.9 + Math.random() * 0.2; // 0.9 to 1.1 (더 작은 범위)
|
targetScale = 0.9 + Math.random() * 0.2;
|
||||||
};
|
};
|
||||||
|
|
||||||
const animate = () => {
|
const animate = () => {
|
||||||
// Slow speed - 일정한 속도로 부드럽게
|
|
||||||
const speed = 0.003;
|
const speed = 0.003;
|
||||||
currentX += (targetX - currentX) * speed;
|
currentX += (targetX - currentX) * speed;
|
||||||
currentY += (targetY - currentY) * speed;
|
currentY += (targetY - currentY) * speed;
|
||||||
scale += (targetScale - scale) * speed;
|
scale += (targetScale - scale) * speed;
|
||||||
|
|
||||||
// Apply transform
|
|
||||||
orb.style.left = `${currentX}%`;
|
orb.style.left = `${currentX}%`;
|
||||||
orb.style.top = `${currentY}%`;
|
orb.style.top = `${currentY}%`;
|
||||||
orb.style.transform = `scale(${scale})`;
|
orb.style.transform = `scale(${scale})`;
|
||||||
|
const distance = Math.sqrt(Math.pow(targetX - currentX, 2) + Math.pow(targetY - currentY, 2));
|
||||||
// Generate new target when close enough
|
if (distance < 1) generateNewTarget();
|
||||||
const distance = Math.sqrt(
|
|
||||||
Math.pow(targetX - currentX, 2) + Math.pow(targetY - currentY, 2)
|
|
||||||
);
|
|
||||||
if (distance < 1) {
|
|
||||||
generateNewTarget();
|
|
||||||
}
|
|
||||||
|
|
||||||
animationRefs.current[index] = requestAnimationFrame(animate);
|
animationRefs.current[index] = requestAnimationFrame(animate);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 첫 타겟 생성 후 애니메이션 시작
|
|
||||||
generateNewTarget();
|
generateNewTarget();
|
||||||
animate();
|
animate();
|
||||||
};
|
};
|
||||||
|
|
||||||
// 모든 공이 동시에 자연스럽게 시작 (딜레이 없이)
|
|
||||||
orbRefs.current.forEach((orb, index) => {
|
orbRefs.current.forEach((orb, index) => {
|
||||||
if (orb) {
|
if (orb) moveOrb(orb, index);
|
||||||
moveOrb(orb, index);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Cleanup
|
|
||||||
return () => {
|
return () => {
|
||||||
animationRefs.current.forEach(id => cancelAnimationFrame(id));
|
animationRefs.current.forEach(id => cancelAnimationFrame(id));
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const error = externalError || localError;
|
|
||||||
|
|
||||||
const getPlaceholder = () => {
|
|
||||||
return searchType === 'url'
|
|
||||||
? 'https://www.castad.com'
|
|
||||||
: t('landing.hero.placeholderBusinessName');
|
|
||||||
};
|
|
||||||
|
|
||||||
const getGuideText = () => {
|
|
||||||
return searchType === 'url'
|
|
||||||
? t('landing.hero.guideUrl')
|
|
||||||
: t('landing.hero.guideBusinessName');
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleStart = () => {
|
|
||||||
if (!inputValue.trim()) {
|
|
||||||
setLocalError(searchType === 'url' ? t('landing.hero.errorUrlRequired') : t('landing.hero.errorNameRequired'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (searchType === 'url' && !isValidUrl(inputValue.trim())) {
|
|
||||||
setLocalError(t('landing.hero.errorInvalidUrl'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
setLocalError('');
|
|
||||||
|
|
||||||
if (searchType === 'name' && selectedItem && onAutocomplete) {
|
|
||||||
// 업체명 검색인 경우 autocomplete API 호출
|
|
||||||
const request: AutocompleteRequest = {
|
|
||||||
address: selectedItem.address,
|
|
||||||
roadAddress: selectedItem.roadAddress,
|
|
||||||
title: selectedItem.title,
|
|
||||||
};
|
|
||||||
onAutocomplete(request);
|
|
||||||
} else if (onAnalyze) {
|
|
||||||
// URL 검색인 경우 기존 로직
|
|
||||||
onAnalyze(inputValue, searchType);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="hero-section">
|
<div className="hero-section">
|
||||||
{/* Animated background orbs - 스크롤에 따라 빠르게 사라짐 */}
|
{/* Animated background orbs */}
|
||||||
<div
|
<div
|
||||||
className="hero-bg-orbs"
|
className="hero-bg-orbs"
|
||||||
style={{ opacity: Math.max(0, 1 - scrollProgress * 3) }}
|
style={{ opacity: Math.max(0, 1 - scrollProgress * 3) }}
|
||||||
@@ -321,168 +162,69 @@ const HeroSection: React.FC<HeroSectionProps> = ({ onAnalyze, onAutocomplete, on
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="hero-content">
|
<div className="hero-content">
|
||||||
{/* Logo Image */}
|
|
||||||
<img
|
<img
|
||||||
src="/assets/images/ado2-logo.svg"
|
src="/assets/images/ADO2_with Slogan_white.svg"
|
||||||
alt="ADO2"
|
alt="ADO2"
|
||||||
className="hero-logo"
|
className="hero-logo"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<SearchInputForm
|
||||||
{/* Input Form */}
|
onAnalyze={onAnalyze}
|
||||||
<div className="hero-form">
|
onAutocomplete={onAutocomplete}
|
||||||
<div className={`hero-input-wrapper ${isFocused ? 'focused' : ''} ${error ? 'error' : ''} ${inputValue && !isFocused ? 'filled' : ''}`}>
|
onManualInput={onManualInput}
|
||||||
{/* 드롭다운 */}
|
onManualButtonClick={() => {
|
||||||
<div className="hero-dropdown-container" ref={dropdownRef}>
|
if (isLoggedIn()) {
|
||||||
<button
|
setIsManualModalOpen(true);
|
||||||
type="button"
|
} else {
|
||||||
className="hero-dropdown-trigger"
|
setIsLoginPromptOpen(true);
|
||||||
onClick={() => setIsDropdownOpen(!isDropdownOpen)}
|
}
|
||||||
>
|
}}
|
||||||
<span>{searchTypeOptions.find(opt => opt.value === searchType)?.label}</span>
|
error={externalError || testError || null}
|
||||||
<svg
|
/>
|
||||||
width="12"
|
|
||||||
height="12"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
strokeWidth="2"
|
|
||||||
className={`hero-dropdown-arrow ${isDropdownOpen ? 'open' : ''}`}
|
|
||||||
>
|
|
||||||
<path d="M6 9l6 6 6-6" />
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
{isDropdownOpen && (
|
|
||||||
<div className="hero-dropdown-menu">
|
|
||||||
{searchTypeOptions.map((option) => (
|
|
||||||
<button
|
|
||||||
key={option.value}
|
|
||||||
type="button"
|
|
||||||
className={`hero-dropdown-item ${searchType === option.value ? 'active' : ''}`}
|
|
||||||
onClick={() => {
|
|
||||||
setSearchType(option.value);
|
|
||||||
setIsDropdownOpen(false);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{option.label}
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="hero-input-container" ref={autocompleteRef}>
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
value={inputValue}
|
|
||||||
onChange={(e) => {
|
|
||||||
const value = e.target.value;
|
|
||||||
setInputValue(value);
|
|
||||||
setHighlightedIndex(-1); // 입력 시 하이라이트 초기화
|
|
||||||
if (localError) setLocalError('');
|
|
||||||
|
|
||||||
// 업체명 검색일 때 자동완성 검색 (디바운스)
|
|
||||||
if (searchType === 'name') {
|
|
||||||
if (debounceRef.current) {
|
|
||||||
clearTimeout(debounceRef.current);
|
|
||||||
}
|
|
||||||
debounceRef.current = setTimeout(() => {
|
|
||||||
handleAutocompleteSearch(value);
|
|
||||||
}, 300);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onFocus={() => {
|
|
||||||
setIsFocused(true);
|
|
||||||
if (searchType === 'name' && autocompleteResults.length > 0) {
|
|
||||||
setShowAutocomplete(true);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onBlur={() => setIsFocused(false)}
|
|
||||||
onKeyDown={handleKeyDown}
|
|
||||||
placeholder={getPlaceholder()}
|
|
||||||
className={`hero-input ${inputValue ? 'has-value' : ''}`}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{/* 자동완성 결과 */}
|
|
||||||
{showAutocomplete && searchType === 'name' && (
|
|
||||||
<div className="hero-autocomplete-dropdown">
|
|
||||||
{isAutocompleteLoading ? (
|
|
||||||
<div className="hero-autocomplete-loading">{t('landing.hero.searching')}</div>
|
|
||||||
) : (
|
|
||||||
autocompleteResults.map((item, index) => (
|
|
||||||
<button
|
|
||||||
key={index}
|
|
||||||
type="button"
|
|
||||||
className={`hero-autocomplete-item ${highlightedIndex === index ? 'highlighted' : ''}`}
|
|
||||||
onMouseDown={(e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
handleSelectAutocomplete(item);
|
|
||||||
}}
|
|
||||||
onMouseEnter={() => setHighlightedIndex(index)}
|
|
||||||
>
|
|
||||||
<div className="hero-autocomplete-title" dangerouslySetInnerHTML={{ __html: item.title }} />
|
|
||||||
<div className="hero-autocomplete-address">{item.roadAddress || item.address}</div>
|
|
||||||
</button>
|
|
||||||
))
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
{inputValue && (
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="hero-input-clear"
|
|
||||||
onClick={() => {
|
|
||||||
setInputValue('');
|
|
||||||
setLocalError('');
|
|
||||||
setAutocompleteResults([]);
|
|
||||||
setShowAutocomplete(false);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<img src="/assets/images/input-clear-icon.svg" alt="Clear" />
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<span className="hero-input-hint">{getGuideText()}</span>
|
|
||||||
{error && (
|
|
||||||
<p className="hero-error">{error}</p>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<button onClick={handleStart} className="hero-button">
|
|
||||||
{t('landing.hero.analyzeButton')}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Footer Indicator */}
|
{/* Footer Indicator */}
|
||||||
<button onClick={onNext} className="scroll-indicator">
|
<button onClick={onNext} className="scroll-indicator">
|
||||||
<span className="scroll-indicator-text">{t('landing.hero.scrollMore')}</span>
|
<span className="scroll-indicator-text">{t('landing.hero.scrollMore')}</span>
|
||||||
<div className="scroll-indicator-icon">
|
<div className="scroll-indicator-icon">
|
||||||
<svg
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1" strokeLinecap="round" strokeLinejoin="round">
|
||||||
width="24"
|
|
||||||
height="24"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
strokeWidth="1"
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
>
|
|
||||||
<path d="M7 10l5 5 5-5" />
|
<path d="M7 10l5 5 5-5" />
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{/* 테스트 버튼 (VITE_IS_TESTPAGE=true일 때만 표시) */}
|
{/* 테스트 버튼 */}
|
||||||
{isTestPage && onTestData && (
|
{isTestPage && onTestData && (
|
||||||
<button
|
<button onClick={handleTestData} disabled={isLoadingTest} className="test-data-button">
|
||||||
onClick={handleTestData}
|
|
||||||
disabled={isLoadingTest}
|
|
||||||
className="test-data-button"
|
|
||||||
>
|
|
||||||
{isLoadingTest ? t('landing.hero.testDataLoading') : t('landing.hero.testData')}
|
{isLoadingTest ? t('landing.hero.testDataLoading') : t('landing.hero.testData')}
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{tutorial.isActive && !isManualModalOpen && (
|
||||||
|
<TutorialOverlay
|
||||||
|
hints={tutorial.hints}
|
||||||
|
currentIndex={tutorial.currentHintIndex}
|
||||||
|
onNext={tutorial.nextHint}
|
||||||
|
onPrev={tutorial.prevHint}
|
||||||
|
onSkip={tutorial.skipTutorial}
|
||||||
|
groupProgress={tutorial.groupProgress}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{isManualModalOpen && (
|
||||||
|
<BusinessNameInputModal
|
||||||
|
onClose={() => setIsManualModalOpen(false)}
|
||||||
|
onSubmit={(businessName, address) => {
|
||||||
|
if (tutorial.isActive) tutorial.nextHint();
|
||||||
|
setIsManualModalOpen(false);
|
||||||
|
onManualInput?.(businessName, address);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{isLoginPromptOpen && (
|
||||||
|
<LoginPromptModal onClose={() => setIsLoginPromptOpen(false)} />
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ const LoginSection: React.FC<LoginSectionProps> = ({ onBack, onLogin }) => {
|
|||||||
<div className="login-content">
|
<div className="login-content">
|
||||||
{/* Logo */}
|
{/* Logo */}
|
||||||
<div className="login-logo">
|
<div className="login-logo">
|
||||||
<img src="/assets/images/ado2-login-logo.svg" alt="ADO2" />
|
<img src="/assets/images/ADO2_with Slogan_white.svg" alt="ADO2" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Error Message */}
|
{/* Error Message */}
|
||||||
|
|||||||
+73
-3
@@ -67,6 +67,8 @@ export interface LyricGenerateRequest {
|
|||||||
m_id: number;
|
m_id: number;
|
||||||
region: string;
|
region: string;
|
||||||
task_id: string;
|
task_id: string;
|
||||||
|
orientation?: 'vertical' | 'horizontal';
|
||||||
|
instrumental?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 가사 생성 응답
|
// 가사 생성 응답
|
||||||
@@ -102,8 +104,9 @@ export interface LyricDetailResponse {
|
|||||||
// 노래 생성 요청
|
// 노래 생성 요청
|
||||||
export interface SongGenerateRequest {
|
export interface SongGenerateRequest {
|
||||||
genre: string;
|
genre: string;
|
||||||
language: string;
|
language?: string;
|
||||||
lyrics: string;
|
lyrics?: string;
|
||||||
|
instrumental?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 노래 생성 응답
|
// 노래 생성 응답
|
||||||
@@ -140,6 +143,13 @@ export interface SongDownloadResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 영상 생성 응답
|
// 영상 생성 응답
|
||||||
|
// 자막 상태 확인 응답
|
||||||
|
export interface SubtitleStatusResponse {
|
||||||
|
task_id: string;
|
||||||
|
status: string; // 'pending' | 'processing' | 'completed' | 'failed' | 'error'
|
||||||
|
message: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface VideoGenerateResponse {
|
export interface VideoGenerateResponse {
|
||||||
success: boolean;
|
success: boolean;
|
||||||
task_id: string;
|
task_id: string;
|
||||||
@@ -253,14 +263,33 @@ export interface UserMeResponse {
|
|||||||
created_at: string;
|
created_at: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 비디오 목록 아이템
|
export interface UserCreditsResponse {
|
||||||
|
credits: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 비디오 목록 아이템 (갤러리용)
|
||||||
export interface VideoListItem {
|
export interface VideoListItem {
|
||||||
video_id: number;
|
video_id: number;
|
||||||
store_name: string;
|
store_name: string;
|
||||||
region: string;
|
region: string;
|
||||||
task_id: string;
|
task_id: string;
|
||||||
result_movie_url: string;
|
result_movie_url: string;
|
||||||
|
thumbnail_url?: string;
|
||||||
created_at: string;
|
created_at: string;
|
||||||
|
like_count: number;
|
||||||
|
comment_count: number;
|
||||||
|
is_liked_by_me?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 비디오 상세 아이템
|
||||||
|
export interface VideoDetailItem {
|
||||||
|
video_id: number;
|
||||||
|
result_movie_url: string;
|
||||||
|
store_name: string;
|
||||||
|
region: string;
|
||||||
|
created_at: string;
|
||||||
|
like_count: number;
|
||||||
|
is_liked_by_me: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 비디오 목록 응답
|
// 비디오 목록 응답
|
||||||
@@ -274,6 +303,45 @@ export interface VideosListResponse {
|
|||||||
has_prev: boolean;
|
has_prev: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 댓글 대댓글
|
||||||
|
export interface CommentReply {
|
||||||
|
id: number;
|
||||||
|
nickname: string;
|
||||||
|
content: string | null;
|
||||||
|
is_deleted: boolean;
|
||||||
|
is_mine: boolean;
|
||||||
|
created_at: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 댓글 아이템
|
||||||
|
export interface CommentItem {
|
||||||
|
id: number;
|
||||||
|
nickname: string;
|
||||||
|
content: string | null;
|
||||||
|
is_deleted: boolean;
|
||||||
|
is_mine: boolean;
|
||||||
|
created_at: string;
|
||||||
|
replies: CommentReply[];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 댓글 목록 응답
|
||||||
|
export interface CommentsResponse {
|
||||||
|
items: CommentItem[];
|
||||||
|
total: number;
|
||||||
|
page: number;
|
||||||
|
page_size: number;
|
||||||
|
total_pages: number;
|
||||||
|
has_next: boolean;
|
||||||
|
has_prev: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 좋아요 토글 응답
|
||||||
|
export interface LikeToggleResponse {
|
||||||
|
video_id: number;
|
||||||
|
is_liked: boolean;
|
||||||
|
like_count: number;
|
||||||
|
}
|
||||||
|
|
||||||
// ============================================
|
// ============================================
|
||||||
// Social OAuth Types
|
// Social OAuth Types
|
||||||
// ============================================
|
// ============================================
|
||||||
@@ -374,6 +442,8 @@ export interface UploadHistoryItem {
|
|||||||
status: 'pending' | 'uploading' | 'completed' | 'failed' | 'scheduled' | 'cancelled';
|
status: 'pending' | 'uploading' | 'completed' | 'failed' | 'scheduled' | 'cancelled';
|
||||||
title: string;
|
title: string;
|
||||||
channel_name: string;
|
channel_name: string;
|
||||||
|
platform_user_id: string | null;
|
||||||
|
platform_username: string | null;
|
||||||
scheduled_at: string | null;
|
scheduled_at: string | null;
|
||||||
uploaded_at: string | null;
|
uploaded_at: string | null;
|
||||||
created_at: string;
|
created_at: string;
|
||||||
|
|||||||
+232
-9
@@ -8,6 +8,7 @@ import {
|
|||||||
SongGenerateResponse,
|
SongGenerateResponse,
|
||||||
SongStatusResponse,
|
SongStatusResponse,
|
||||||
SongDownloadResponse,
|
SongDownloadResponse,
|
||||||
|
SubtitleStatusResponse,
|
||||||
VideoGenerateResponse,
|
VideoGenerateResponse,
|
||||||
VideoStatusResponse,
|
VideoStatusResponse,
|
||||||
VideoDownloadResponse,
|
VideoDownloadResponse,
|
||||||
@@ -28,6 +29,11 @@ import {
|
|||||||
TokenExpiredErrorResponse,
|
TokenExpiredErrorResponse,
|
||||||
YTAutoSeoRequest,
|
YTAutoSeoRequest,
|
||||||
YTAutoSeoResponse,
|
YTAutoSeoResponse,
|
||||||
|
UserCreditsResponse,
|
||||||
|
VideoDetailItem,
|
||||||
|
CommentsResponse,
|
||||||
|
CommentItem,
|
||||||
|
LikeToggleResponse,
|
||||||
} from '../types/api';
|
} from '../types/api';
|
||||||
|
|
||||||
export const API_URL = import.meta.env.VITE_API_URL || 'http://40.82.133.44';
|
export const API_URL = import.meta.env.VITE_API_URL || 'http://40.82.133.44';
|
||||||
@@ -161,6 +167,8 @@ export async function generateSong(taskId: string, request: SongGenerateRequest)
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
const errorBody = await response.json().catch(() => null);
|
||||||
|
console.error('[generateSong] 422 detail:', JSON.stringify(errorBody));
|
||||||
throw new Error(`HTTP error! status: ${response.status}`);
|
throw new Error(`HTTP error! status: ${response.status}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,6 +250,52 @@ export async function waitForSongComplete(
|
|||||||
return poll();
|
return poll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 자막 상태 확인 API
|
||||||
|
export async function getSubtitleStatus(taskId: string): Promise<SubtitleStatusResponse> {
|
||||||
|
const response = await authenticatedFetch(`${API_URL}/lyric/subtitle/status/${taskId}`, {
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`HTTP error! status: ${response.status}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response.json();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 자막 완료까지 폴링 (5초 간격, 10분 타임아웃)
|
||||||
|
const SUBTITLE_POLL_INTERVAL = 5000;
|
||||||
|
const SUBTITLE_POLL_TIMEOUT = 5 * 60 * 1000;
|
||||||
|
|
||||||
|
export async function waitForSubtitleComplete(
|
||||||
|
taskId: string,
|
||||||
|
onStatusChange?: (status: string) => void
|
||||||
|
): Promise<SubtitleStatusResponse> {
|
||||||
|
const startTime = Date.now();
|
||||||
|
|
||||||
|
const poll = async (): Promise<SubtitleStatusResponse> => {
|
||||||
|
if (Date.now() - startTime > SUBTITLE_POLL_TIMEOUT) {
|
||||||
|
throw new Error('TIMEOUT');
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await getSubtitleStatus(taskId);
|
||||||
|
onStatusChange?.(response.status);
|
||||||
|
|
||||||
|
if (response.status === 'completed') {
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (response.status === 'failed' || response.status === 'error') {
|
||||||
|
throw new Error(response.message || '자막 생성에 실패했습니다.');
|
||||||
|
}
|
||||||
|
|
||||||
|
await new Promise(resolve => setTimeout(resolve, SUBTITLE_POLL_INTERVAL));
|
||||||
|
return poll();
|
||||||
|
};
|
||||||
|
|
||||||
|
return poll();
|
||||||
|
}
|
||||||
|
|
||||||
// 영상 생성 API
|
// 영상 생성 API
|
||||||
export async function generateVideo(taskId: string, orientation: 'vertical' | 'horizontal' = 'vertical'): Promise<VideoGenerateResponse> {
|
export async function generateVideo(taskId: string, orientation: 'vertical' | 'horizontal' = 'vertical'): Promise<VideoGenerateResponse> {
|
||||||
const response = await authenticatedFetch(`${API_URL}/video/generate/${taskId}?orientation=${orientation}`, {
|
const response = await authenticatedFetch(`${API_URL}/video/generate/${taskId}?orientation=${orientation}`, {
|
||||||
@@ -323,6 +377,99 @@ export async function deleteVideo(videoId: number): Promise<void> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 전체 사용자 영상 목록 조회 API (ADO2 콘텐츠 갤러리용)
|
||||||
|
export async function getAllVideos(
|
||||||
|
page: number = 1,
|
||||||
|
pageSize: number = 20,
|
||||||
|
sortBy: 'created_at' | 'like_count' | 'comment_count' = 'created_at',
|
||||||
|
storeName: string = '',
|
||||||
|
order: 'desc' | 'asc' = 'desc',
|
||||||
|
region: string = '',
|
||||||
|
): Promise<VideosListResponse> {
|
||||||
|
const params = new URLSearchParams({
|
||||||
|
page: String(page),
|
||||||
|
page_size: String(pageSize),
|
||||||
|
sort_by: sortBy,
|
||||||
|
order,
|
||||||
|
});
|
||||||
|
if (storeName.trim()) params.set('store_name', storeName.trim());
|
||||||
|
if (region.trim()) params.set('region', region.trim());
|
||||||
|
const response = await authenticatedFetch(`${API_URL}/video/all?${params.toString()}`, {
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`HTTP error! status: ${response.status}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response.json();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 단일 영상 상세 조회 API
|
||||||
|
export async function getVideoById(videoId: string): Promise<VideoDetailItem> {
|
||||||
|
const response = await authenticatedFetch(`${API_URL}/video/${videoId}`, {
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`HTTP error! status: ${response.status}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response.json();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 댓글 목록 조회
|
||||||
|
export async function getVideoComments(videoId: string, page: number = 1, pageSize: number = 20): Promise<CommentsResponse> {
|
||||||
|
const response = await authenticatedFetch(`${API_URL}/comment/video/${videoId}?page=${page}&page_size=${pageSize}`, {
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`HTTP error! status: ${response.status}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response.json();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 댓글 작성
|
||||||
|
export async function postVideoComment(videoId: string, content: string, nickname?: string, parentId?: number): Promise<CommentItem> {
|
||||||
|
const response = await authenticatedFetch(`${API_URL}/comment/video/${videoId}`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
body: JSON.stringify({ content, nickname: nickname || '익명', parent_id: parentId ?? null }),
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`HTTP error! status: ${response.status}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response.json();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 댓글 삭제
|
||||||
|
export async function deleteComment(commentId: number): Promise<void> {
|
||||||
|
const response = await authenticatedFetch(`${API_URL}/comment/${commentId}`, {
|
||||||
|
method: 'DELETE',
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`HTTP error! status: ${response.status}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 좋아요 토글
|
||||||
|
export async function toggleVideoLike(videoId: string): Promise<LikeToggleResponse> {
|
||||||
|
const response = await authenticatedFetch(`${API_URL}/video/${videoId}/like`, {
|
||||||
|
method: 'POST',
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`HTTP error! status: ${response.status}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response.json();
|
||||||
|
}
|
||||||
|
|
||||||
// 이미지 업로드 API (multipart/form-data)
|
// 이미지 업로드 API (multipart/form-data)
|
||||||
// 타임아웃: 5분 (많은 이미지 업로드 시 시간이 오래 걸릴 수 있음)
|
// 타임아웃: 5분 (많은 이미지 업로드 시 시간이 오래 걸릴 수 있음)
|
||||||
const IMAGE_UPLOAD_TIMEOUT = 5 * 60 * 1000;
|
const IMAGE_UPLOAD_TIMEOUT = 5 * 60 * 1000;
|
||||||
@@ -476,14 +623,20 @@ export async function authenticatedFetch(
|
|||||||
|
|
||||||
let response = await fetch(url, { ...options, headers });
|
let response = await fetch(url, { ...options, headers });
|
||||||
|
|
||||||
// 401 에러 시 토큰 갱신 시도
|
// 401 에러 시 에러 코드에 따라 처리
|
||||||
if (response.status === 401) {
|
if (response.status === 401) {
|
||||||
|
const errorBody = await response.json().catch(() => null);
|
||||||
|
const errorCode = errorBody?.detail?.code;
|
||||||
|
|
||||||
|
if (errorCode !== 'TOKEN_EXPIRED') {
|
||||||
|
// INVALID_TOKEN 등 갱신으로 해결 불가한 경우 즉시 로그인 이동
|
||||||
|
redirectToLogin();
|
||||||
|
throw new Error(errorCode ?? 'Unauthorized');
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 이미 갱신 중이면 기존 Promise 재사용 (중복 요청 방지)
|
|
||||||
// refreshPromise가 존재하면 재사용, 없으면 새로 생성
|
|
||||||
if (!refreshPromise) {
|
if (!refreshPromise) {
|
||||||
refreshPromise = refreshAccessToken().finally(() => {
|
refreshPromise = refreshAccessToken().finally(() => {
|
||||||
// 성공/실패 상관없이 Promise 초기화 (다음 갱신을 위해)
|
|
||||||
refreshPromise = null;
|
refreshPromise = null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -500,7 +653,6 @@ export async function authenticatedFetch(
|
|||||||
response = await fetch(url, { ...options, headers: newHeaders });
|
response = await fetch(url, { ...options, headers: newHeaders });
|
||||||
} catch (refreshError) {
|
} catch (refreshError) {
|
||||||
console.error('Token refresh failed:', refreshError);
|
console.error('Token refresh failed:', refreshError);
|
||||||
// 토큰 갱신 실패 시 로그인 페이지로 리다이렉트
|
|
||||||
redirectToLogin();
|
redirectToLogin();
|
||||||
throw refreshError;
|
throw refreshError;
|
||||||
}
|
}
|
||||||
@@ -596,14 +748,28 @@ export async function refreshAccessToken(): Promise<TokenRefreshResponse> {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 로컬 스토리지 전체 정리
|
||||||
|
function clearAllLocalData() {
|
||||||
|
clearTokens();
|
||||||
|
localStorage.removeItem('castad_view_mode');
|
||||||
|
localStorage.removeItem('castad_analysis_data');
|
||||||
|
localStorage.removeItem('castad_wizard_step');
|
||||||
|
localStorage.removeItem('castad_active_item');
|
||||||
|
localStorage.removeItem('castad_song_task_id');
|
||||||
|
localStorage.removeItem('castad_image_task_id');
|
||||||
|
localStorage.removeItem('castad_song_generation');
|
||||||
|
localStorage.removeItem('castad_video_generation');
|
||||||
|
localStorage.removeItem('castad_video_ratio');
|
||||||
|
}
|
||||||
|
|
||||||
// 로그아웃
|
// 로그아웃
|
||||||
export async function logout(): Promise<void> {
|
export async function logout(): Promise<void> {
|
||||||
const response = await authenticatedFetch(`${API_URL}/user/auth/logout`, {
|
const response = await authenticatedFetch(`${API_URL}/user/auth/logout`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
});
|
});
|
||||||
|
|
||||||
// 응답과 관계없이 로컬 토큰 삭제
|
// 응답과 관계없이 로컬 데이터 전체 삭제
|
||||||
clearTokens();
|
clearAllLocalData();
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error(`HTTP error! status: ${response.status}`);
|
throw new Error(`HTTP error! status: ${response.status}`);
|
||||||
@@ -616,8 +782,8 @@ export async function logoutAll(): Promise<void> {
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
});
|
});
|
||||||
|
|
||||||
// 응답과 관계없이 로컬 토큰 삭제
|
// 응답과 관계없이 로컬 데이터 전체 삭제
|
||||||
clearTokens();
|
clearAllLocalData();
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error(`HTTP error! status: ${response.status}`);
|
throw new Error(`HTTP error! status: ${response.status}`);
|
||||||
@@ -637,6 +803,32 @@ export async function getUserMe(): Promise<UserMeResponse> {
|
|||||||
return response.json();
|
return response.json();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 사용자 크레딧 조회
|
||||||
|
export async function getUserCredits(): Promise<UserCreditsResponse> {
|
||||||
|
const response = await authenticatedFetch(`${API_URL}/user/auth/me/credits`, {
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`HTTP error! status: ${response.status}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response.json();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 크레딧 충전 요청
|
||||||
|
export async function requestCreditCharge(amount: number, note: string): Promise<void> {
|
||||||
|
const response = await authenticatedFetch(`${API_URL}/user/credits/charge-requests`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
body: JSON.stringify({ requested_amount: amount, message: note }),
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`HTTP error! status: ${response.status}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 로그인 여부 확인
|
// 로그인 여부 확인
|
||||||
export function isLoggedIn(): boolean {
|
export function isLoggedIn(): boolean {
|
||||||
return !!getAccessToken();
|
return !!getAccessToken();
|
||||||
@@ -708,6 +900,37 @@ export async function autocomplete(request: AutocompleteRequest): Promise<Crawli
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 업체명·주소 직접 입력으로 마케팅 분석
|
||||||
|
export async function marketingAnalysis(storeName: string, address: string): Promise<CrawlingResponse> {
|
||||||
|
const controller = new AbortController();
|
||||||
|
const timeoutId = setTimeout(() => controller.abort(), CRAWL_TIMEOUT);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await authenticatedFetch(`${API_URL}/marketing`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
body: JSON.stringify({ store_name: storeName, address }),
|
||||||
|
signal: controller.signal,
|
||||||
|
});
|
||||||
|
|
||||||
|
clearTimeout(timeoutId);
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`HTTP error! status: ${response.status}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response.json();
|
||||||
|
} catch (error) {
|
||||||
|
clearTimeout(timeoutId);
|
||||||
|
if (error instanceof Error && error.name === 'AbortError') {
|
||||||
|
throw new Error('요청 시간이 초과되었습니다. 다시 시도해주세요.');
|
||||||
|
}
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ============================================
|
// ============================================
|
||||||
// Social OAuth TOKEN_EXPIRED 처리
|
// Social OAuth TOKEN_EXPIRED 처리
|
||||||
// ============================================
|
// ============================================
|
||||||
|
|||||||
Reference in new issue
Block a user