로컬라이제이션 적용 (영어 / 한국어 )
This commit is contained in:
1 parent
29fdb7e65c
commit
ad6f9e09a1
30 files changed
+1474
-309
No files matched your search
@@ -1,5 +1,6 @@
|
||||
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { getVideosList, deleteVideo } from '../../utils/api';
|
||||
import { VideoListItem } from '../../types/api';
|
||||
import SocialPostingModal from '../../components/SocialPostingModal';
|
||||
@@ -9,6 +10,7 @@ interface ADO2ContentsPageProps {
|
||||
}
|
||||
|
||||
const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = ({ onBack }) => {
|
||||
const { t } = useTranslation();
|
||||
const [videos, setVideos] = useState<VideoListItem[]>([]);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [loading, setLoading] = useState(true);
|
||||
@@ -45,7 +47,7 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = ({ onBack }) => {
|
||||
setHasPrev(response.has_prev);
|
||||
} catch (err) {
|
||||
console.error('Failed to fetch videos:', err);
|
||||
setError('콘텐츠를 불러오는데 실패했습니다.');
|
||||
setError(t('ado2Contents.loadFailed'));
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
@@ -84,7 +86,7 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = ({ onBack }) => {
|
||||
document.body.removeChild(a);
|
||||
} catch (err) {
|
||||
console.error('Download failed:', err);
|
||||
alert('다운로드에 실패했습니다.');
|
||||
alert(t('ado2Contents.downloadFailed'));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -126,7 +128,7 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = ({ onBack }) => {
|
||||
setDeleteTargetId(null);
|
||||
} catch (err) {
|
||||
console.error('Delete failed:', err);
|
||||
alert('삭제에 실패했습니다.');
|
||||
alert(t('ado2Contents.deleteFailed'));
|
||||
} finally {
|
||||
setIsDeleting(false);
|
||||
}
|
||||
@@ -136,24 +138,24 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = ({ onBack }) => {
|
||||
<div className="ado2-contents-page">
|
||||
{/* Header */}
|
||||
<div className="ado2-contents-header">
|
||||
<h1 className="ado2-contents-title">ADO2 콘텐츠</h1>
|
||||
<span className="ado2-contents-count">총 {total}개</span>
|
||||
<h1 className="ado2-contents-title">{t('ado2Contents.title')}</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>콘텐츠를 불러오는 중...</p>
|
||||
<p>{t('ado2Contents.loading')}</p>
|
||||
</div>
|
||||
) : error ? (
|
||||
<div className="ado2-contents-error">
|
||||
<p>{error}</p>
|
||||
<button onClick={fetchVideos} className="retry-btn">다시 시도</button>
|
||||
<button onClick={fetchVideos} className="retry-btn">{t('ado2Contents.retry')}</button>
|
||||
</div>
|
||||
) : videos.length === 0 ? (
|
||||
<div className="ado2-contents-empty">
|
||||
<p>생성된 콘텐츠가 없습니다.</p>
|
||||
<p>{t('ado2Contents.noContent')}</p>
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
@@ -212,13 +214,13 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = ({ onBack }) => {
|
||||
<path d="M10 3v10M10 13l-4-4M10 13l4-4"/>
|
||||
<path d="M3 15v2h14v-2"/>
|
||||
</svg>
|
||||
<span>다운로드</span>
|
||||
<span>{t('ado2Contents.download')}</span>
|
||||
</button>
|
||||
<button
|
||||
className="content-upload-btn"
|
||||
onClick={() => handleUploadClick(video)}
|
||||
disabled={!video.result_movie_url}
|
||||
title="소셜 미디어에 업로드"
|
||||
title={t('ado2Contents.uploadToSocial')}
|
||||
>
|
||||
<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"/>
|
||||
@@ -248,7 +250,7 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = ({ onBack }) => {
|
||||
onClick={() => setPage(p => p - 1)}
|
||||
disabled={!hasPrev}
|
||||
>
|
||||
이전
|
||||
{t('ado2Contents.previous')}
|
||||
</button>
|
||||
<span className="pagination-info">{page} / {totalPages}</span>
|
||||
<button
|
||||
@@ -256,7 +258,7 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = ({ onBack }) => {
|
||||
onClick={() => setPage(p => p + 1)}
|
||||
disabled={!hasNext}
|
||||
>
|
||||
다음
|
||||
{t('ado2Contents.next')}
|
||||
</button>
|
||||
</div>
|
||||
</>
|
||||
@@ -266,22 +268,22 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = ({ onBack }) => {
|
||||
{deleteModalOpen && (
|
||||
<div className="delete-modal-overlay" onClick={handleDeleteCancel}>
|
||||
<div className="delete-modal" onClick={(e: React.MouseEvent) => e.stopPropagation()}>
|
||||
<h2 className="delete-modal-title">정말 콘텐츠를 삭제할까요?</h2>
|
||||
<p className="delete-modal-description">삭제한 파일은 복구할 수 없어요.</p>
|
||||
<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 ? '삭제 중...' : '삭제'}
|
||||
{isDeleting ? t('ado2Contents.deleting') : t('ado2Contents.delete')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
import React, { useRef, useState, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { ImageItem, ImageUrlItem } from '../../types/api';
|
||||
import { uploadImages } from '../../utils/api';
|
||||
|
||||
@@ -18,6 +19,7 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
onRemoveImage,
|
||||
onAddImages,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const fileInputRef = useRef<HTMLInputElement>(null);
|
||||
const imageListRef = useRef<HTMLDivElement>(null);
|
||||
const [isUploading, setIsUploading] = useState(false);
|
||||
@@ -65,7 +67,7 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Image upload failed:', error);
|
||||
setUploadError(error instanceof Error ? error.message : '이미지 업로드에 실패했습니다.');
|
||||
setUploadError(error instanceof Error ? error.message : t('assetManagement.uploadFailed'));
|
||||
} finally {
|
||||
setIsUploading(false);
|
||||
}
|
||||
@@ -109,13 +111,13 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
return (
|
||||
<main className="page-container">
|
||||
{/* Title */}
|
||||
<h1 className="asset-title">브랜드 에셋</h1>
|
||||
<h1 className="asset-title">{t('assetManagement.title')}</h1>
|
||||
|
||||
{/* Main Content Container */}
|
||||
<div className="asset-container">
|
||||
{/* Left Column - Selected Images */}
|
||||
<div className="asset-column asset-column-left">
|
||||
<h3 className="asset-section-title">선택된 이미지</h3>
|
||||
<h3 className="asset-section-title">{t('assetManagement.selectedImages')}</h3>
|
||||
<div
|
||||
ref={imageListRef}
|
||||
onWheel={handleImageListWheel}
|
||||
@@ -127,10 +129,10 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
<div key={i} className="asset-image-item">
|
||||
<img
|
||||
src={getImageSrc(item)}
|
||||
alt={`이미지 ${i + 1}`}
|
||||
alt={`${t('assetManagement.imageAlt')} ${i + 1}`}
|
||||
/>
|
||||
{item.type === 'file' && (
|
||||
<div className="asset-image-badge">업로드</div>
|
||||
<div className="asset-image-badge">{t('assetManagement.uploadBadge')}</div>
|
||||
)}
|
||||
<button
|
||||
onClick={() => onRemoveImage(i)}
|
||||
@@ -152,7 +154,7 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
<div className="asset-column asset-column-right">
|
||||
{/* Image Upload Section */}
|
||||
<div className="asset-upload-section">
|
||||
<h3 className="asset-section-title">이미지 업로드</h3>
|
||||
<h3 className="asset-section-title">{t('assetManagement.imageUpload')}</h3>
|
||||
<div
|
||||
onClick={handleFileSelect}
|
||||
onDragOver={handleDragOver}
|
||||
@@ -160,7 +162,9 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
className="asset-upload-zone"
|
||||
>
|
||||
<p className="asset-upload-text">
|
||||
이미지를 드래그하여<br/>업로드
|
||||
{t('assetManagement.dragAndDrop').split('\n').map((line, i) => (
|
||||
<React.Fragment key={i}>{i > 0 && <br/>}{line}</React.Fragment>
|
||||
))}
|
||||
</p>
|
||||
</div>
|
||||
<input
|
||||
@@ -175,7 +179,7 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
|
||||
{/* Video Ratio Section */}
|
||||
<div className="asset-ratio-section">
|
||||
<h3 className="asset-section-title">영상 비율</h3>
|
||||
<h3 className="asset-section-title">{t('assetManagement.videoRatio')}</h3>
|
||||
<div className="asset-ratio-buttons">
|
||||
<button
|
||||
onClick={() => handleVideoRatioChange('vertical')}
|
||||
@@ -210,7 +214,7 @@ const AssetManagementContent: React.FC<AssetManagementContentProps> = ({
|
||||
disabled={imageList.length === 0 || isUploading}
|
||||
className="asset-next-button"
|
||||
>
|
||||
{isUploading ? '업로드 중...' : '다음 단계'}
|
||||
{isUploading ? t('assetManagement.uploading') : t('assetManagement.nextStep')}
|
||||
</button>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
@@ -1,31 +1,36 @@
|
||||
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const SocialItem: React.FC<{ platform: string; icon: React.ReactNode; color: string }> = ({ platform, icon, color }) => (
|
||||
<div className="social-item">
|
||||
<div className="social-item-left">
|
||||
<div className="social-item-icon" style={{ backgroundColor: color }}>
|
||||
<div className="social-item-icon-inner">{icon}</div>
|
||||
const SocialItem: React.FC<{ platform: string; icon: React.ReactNode; color: string }> = ({ platform, icon, color }) => {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="social-item">
|
||||
<div className="social-item-left">
|
||||
<div className="social-item-icon" style={{ backgroundColor: color }}>
|
||||
<div className="social-item-icon-inner">{icon}</div>
|
||||
</div>
|
||||
<span className="social-item-name">{platform}</span>
|
||||
</div>
|
||||
<span className="social-item-name">{platform}</span>
|
||||
<button className="social-item-connect">{t('businessSettings.connect')}</button>
|
||||
</div>
|
||||
<button className="social-item-connect">연결하기</button>
|
||||
</div>
|
||||
);
|
||||
);
|
||||
};
|
||||
|
||||
const BusinessSettingsContent: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className="settings-container">
|
||||
<div className="settings-header">
|
||||
<h1 className="settings-title">비즈니스 설정</h1>
|
||||
<h1 className="settings-title">{t('businessSettings.title')}</h1>
|
||||
<p className="settings-description">
|
||||
펜션 정보와 YouTube 채널을 설정하여 자동 업로드를 활성화하세요
|
||||
{t('businessSettings.description')}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="settings-card">
|
||||
<div className="settings-card-inner">
|
||||
<h2 className="settings-card-title">공유</h2>
|
||||
<h2 className="settings-card-title">{t('businessSettings.sharing')}</h2>
|
||||
|
||||
<div className="social-items">
|
||||
<SocialItem
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { generateVideo, waitForVideoComplete, getYouTubeConnectUrl, getSocialAccounts, disconnectSocialAccount, TokenExpiredError, handleSocialReconnect } from '../../utils/api';
|
||||
import { SocialAccount } from '../../types/api';
|
||||
|
||||
@@ -30,6 +31,7 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
onVideoStatusChange,
|
||||
onVideoProgressChange
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const [selectedSocials, setSelectedSocials] = useState<string[]>([]);
|
||||
const [videoStatus, setVideoStatus] = useState<VideoStatus>('idle');
|
||||
const [videoUrl, setVideoUrl] = useState<string | null>(null);
|
||||
@@ -123,7 +125,7 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
|
||||
hasStartedGeneration.current = true;
|
||||
setVideoStatus('generating');
|
||||
setStatusMessage('영상 생성을 요청하고 있습니다...');
|
||||
setStatusMessage(t('completion.requestingGeneration'));
|
||||
setErrorMessage(null);
|
||||
|
||||
try {
|
||||
@@ -134,11 +136,11 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
const videoResponse = await generateVideo(songTaskId, orientation);
|
||||
|
||||
if (!videoResponse.success) {
|
||||
throw new Error(videoResponse.error_message || '영상 생성 요청에 실패했습니다.');
|
||||
throw new Error(videoResponse.error_message || t('completion.generationFailed'));
|
||||
}
|
||||
|
||||
setVideoStatus('polling');
|
||||
setStatusMessage('영상을 생성하고 있습니다...');
|
||||
setStatusMessage(t('completion.generatingVideo'));
|
||||
// video/status API는 creatomate_render_id를 사용
|
||||
saveToStorage(videoResponse.creatomate_render_id, songTaskId, 'polling', null);
|
||||
|
||||
@@ -147,7 +149,7 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
} catch (error) {
|
||||
console.error('Video generation failed:', error);
|
||||
setVideoStatus('error');
|
||||
setErrorMessage(error instanceof Error ? error.message : '영상 생성 중 오류가 발생했습니다.');
|
||||
setErrorMessage(error instanceof Error ? error.message : t('completion.generationError'));
|
||||
hasStartedGeneration.current = false;
|
||||
clearStorage();
|
||||
}
|
||||
@@ -157,17 +159,17 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
const getStatusMessage = (status: string): string => {
|
||||
switch (status) {
|
||||
case 'planned':
|
||||
return '예약됨';
|
||||
return t('completion.statusPlanned');
|
||||
case 'waiting':
|
||||
return '대기 중';
|
||||
return t('completion.statusWaiting');
|
||||
case 'transcribing':
|
||||
return '트랜스크립션 중';
|
||||
return t('completion.statusTranscribing');
|
||||
case 'rendering':
|
||||
return '렌더링 중';
|
||||
return t('completion.statusRendering');
|
||||
case 'succeeded':
|
||||
return '완료';
|
||||
return t('completion.statusSucceeded');
|
||||
default:
|
||||
return '처리 중...';
|
||||
return t('completion.statusDefault');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -209,7 +211,7 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
setStatusMessage('');
|
||||
saveToStorage(videoTaskId, currentSongTaskId, 'complete', videoUrlFromResponse);
|
||||
} else {
|
||||
throw new Error('영상 URL을 받지 못했습니다.');
|
||||
throw new Error(t('completion.videoUrlMissing'));
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
@@ -217,10 +219,10 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
|
||||
if (error instanceof Error && error.message === 'TIMEOUT') {
|
||||
setVideoStatus('error');
|
||||
setErrorMessage('영상 생성 시간이 초과되었습니다. 다시 시도해주세요.');
|
||||
setErrorMessage(t('completion.generationTimeout'));
|
||||
} else {
|
||||
setVideoStatus('error');
|
||||
setErrorMessage(error instanceof Error ? error.message : '영상 생성 중 오류가 발생했습니다.');
|
||||
setErrorMessage(error instanceof Error ? error.message : t('completion.generationError'));
|
||||
}
|
||||
|
||||
hasStartedGeneration.current = false;
|
||||
@@ -255,7 +257,7 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
} else if (savedState.status === 'polling') {
|
||||
// 폴링 중이었던 경우 다시 폴링
|
||||
setVideoStatus('polling');
|
||||
setStatusMessage('영상을 처리하고 있습니다... (새로고침 후 복구됨)');
|
||||
setStatusMessage(t('completion.processingAfterRefresh'));
|
||||
hasStartedGeneration.current = true;
|
||||
pollVideoStatus(savedState.videoTaskId, savedState.songTaskId);
|
||||
}
|
||||
@@ -318,7 +320,7 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
}
|
||||
} catch (error) {
|
||||
if (error instanceof TokenExpiredError) {
|
||||
alert('YouTube 인증이 만료되었습니다. 재연동 페이지로 이동합니다.');
|
||||
alert(t('completion.youtubeExpiredAlert'));
|
||||
handleSocialReconnect(error.reconnectUrl);
|
||||
return;
|
||||
}
|
||||
@@ -357,12 +359,12 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
window.location.href = response.auth_url;
|
||||
} catch (error) {
|
||||
if (error instanceof TokenExpiredError) {
|
||||
alert('YouTube 인증이 만료되었습니다. 재연동 페이지로 이동합니다.');
|
||||
alert(t('completion.youtubeExpiredAlert'));
|
||||
handleSocialReconnect(error.reconnectUrl);
|
||||
return;
|
||||
}
|
||||
console.error('YouTube connect failed:', error);
|
||||
setYoutubeError('YouTube 연결에 실패했습니다.');
|
||||
setYoutubeError(t('completion.youtubeConnectFailed'));
|
||||
setIsYoutubeConnecting(false);
|
||||
}
|
||||
};
|
||||
@@ -377,12 +379,12 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
setSelectedSocials(prev => prev.filter(s => s !== 'Youtube'));
|
||||
} catch (error) {
|
||||
if (error instanceof TokenExpiredError) {
|
||||
alert('YouTube 인증이 만료되었습니다. 재연동 페이지로 이동합니다.');
|
||||
alert(t('completion.youtubeExpiredAlert'));
|
||||
handleSocialReconnect(error.reconnectUrl);
|
||||
return;
|
||||
}
|
||||
console.error('YouTube disconnect failed:', error);
|
||||
setYoutubeError('연결 해제에 실패했습니다.');
|
||||
setYoutubeError(t('completion.disconnectFailed'));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -430,24 +432,24 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
// 소셜 채널에 배포
|
||||
const handleDeploy = () => {
|
||||
if (selectedSocials.length === 0) {
|
||||
alert('배포할 소셜 채널을 선택해주세요.');
|
||||
alert(t('completion.selectSocialChannel'));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!videoUrl) {
|
||||
alert('영상이 아직 준비되지 않았습니다.');
|
||||
alert(t('completion.videoNotReady'));
|
||||
return;
|
||||
}
|
||||
|
||||
// 선택된 채널 중 YouTube가 있고 연결된 경우
|
||||
if (selectedSocials.includes('Youtube') && youtubeAccount) {
|
||||
// TODO: YouTube 업로드 API 호출
|
||||
alert(`YouTube 채널 "${youtubeAccount.display_name}"에 영상을 업로드합니다.\n\n(업로드 기능 준비 중)`);
|
||||
alert(t('completion.youtubeUploadMessage', { channelName: youtubeAccount.display_name }));
|
||||
return;
|
||||
}
|
||||
|
||||
// 다른 플랫폼 선택 시
|
||||
alert('선택한 소셜 채널에 배포 기능이 준비 중입니다.');
|
||||
alert(t('completion.deployComingSoon'));
|
||||
};
|
||||
|
||||
const handleRetry = () => {
|
||||
@@ -482,20 +484,20 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<path d="M15 18l-6-6 6-6" />
|
||||
</svg>
|
||||
<span>뒤로가기</span>
|
||||
<span>{t('completion.back')}</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Title */}
|
||||
<h1 className="completion-title">
|
||||
{isLoading ? '영상 생성 중' : videoStatus === 'error' ? '영상 생성 실패' : '콘텐츠 제작 완료'}
|
||||
{isLoading ? t('completion.titleGenerating') : videoStatus === 'error' ? t('completion.titleError') : t('completion.titleComplete')}
|
||||
</h1>
|
||||
|
||||
{/* Main Content Container */}
|
||||
<div className="completion-container">
|
||||
{/* Left: Video Preview */}
|
||||
<div className="completion-column completion-column-left video-preview-card">
|
||||
<h3 className="asset-section-title">이미지 및 영상</h3>
|
||||
<h3 className="asset-section-title">{t('completion.imageAndVideo')}</h3>
|
||||
|
||||
<div className="completion-video-wrapper">
|
||||
<div className="video-container">
|
||||
@@ -519,7 +521,7 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
</svg>
|
||||
<p className="text-gray-400 mb-4">{errorMessage}</p>
|
||||
<button onClick={handleRetry} className="btn-secondary">
|
||||
다시 시도
|
||||
{t('completion.retry')}
|
||||
</button>
|
||||
</div>
|
||||
) : videoUrl ? (
|
||||
@@ -561,12 +563,17 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
{/* AI Optimization Tags - only show when complete */}
|
||||
{videoStatus === 'complete' && (
|
||||
<div className="ai-optimization-section">
|
||||
<h3 className="ai-optimization-title">AI 최적화</h3>
|
||||
<h3 className="ai-optimization-title">{t('completion.aiOptimization')}</h3>
|
||||
<div className="ai-optimization-tags">
|
||||
{['색상 보정', '다이나믹 자막', '비트 싱크', 'SEO 메타 태그'].map(tag => (
|
||||
<div key={tag} className="ai-tag">
|
||||
{[
|
||||
{ key: 'colorCorrection', label: t('completion.aiTagColorCorrection') },
|
||||
{ key: 'dynamicSubtitle', label: t('completion.aiTagDynamicSubtitle') },
|
||||
{ key: 'beatSync', label: t('completion.aiTagBeatSync') },
|
||||
{ key: 'seoMeta', label: t('completion.aiTagSEOMeta') },
|
||||
].map(tag => (
|
||||
<div key={tag.key} className="ai-tag">
|
||||
<div className="ai-tag-dot"></div>
|
||||
<span className="ai-tag-text">{tag}</span>
|
||||
<span className="ai-tag-text">{tag.label}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@@ -577,7 +584,7 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
{/* Right: Sharing */}
|
||||
<div className="completion-column completion-column-right sharing-card">
|
||||
<div className="sharing-content">
|
||||
<h3 className="asset-section-title">공유</h3>
|
||||
<h3 className="asset-section-title">{t('completion.sharing')}</h3>
|
||||
|
||||
<div className="social-list-new">
|
||||
{socials.map(social => {
|
||||
@@ -616,14 +623,14 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
</div>
|
||||
</div>
|
||||
{social.isConnecting ? (
|
||||
<span className="completion-social-status connecting">연결 중...</span>
|
||||
<span className="completion-social-status connecting">{t('completion.connecting')}</span>
|
||||
) : social.connected ? (
|
||||
<div className="completion-social-actions">
|
||||
<span className="completion-social-status connected">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<polyline points="20 6 9 17 4 12" />
|
||||
</svg>
|
||||
인증됨
|
||||
{t('completion.authenticated')}
|
||||
</span>
|
||||
{isYoutube && (
|
||||
<button
|
||||
@@ -633,13 +640,13 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
}}
|
||||
className="completion-social-disconnect"
|
||||
>
|
||||
해제
|
||||
{t('completion.disconnect')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<span className="completion-social-status not-connected">
|
||||
{isYoutube ? '계정 연결' : '준비 중'}
|
||||
{isYoutube ? t('completion.connectAccount') : t('completion.comingSoon')}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
@@ -657,7 +664,7 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
disabled={selectedSocials.length === 0 || videoStatus !== 'complete'}
|
||||
className="btn-completion-deploy"
|
||||
>
|
||||
소셜 채널에 배포
|
||||
{t('completion.deployToSocial')}
|
||||
</button>
|
||||
|
||||
<button
|
||||
@@ -665,7 +672,7 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
disabled={videoStatus !== 'complete' || !videoUrl}
|
||||
className="btn-completion-download"
|
||||
>
|
||||
MP4 파일 다운로드
|
||||
{t('completion.downloadMp4')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
// =====================================================
|
||||
// Types
|
||||
@@ -263,6 +264,7 @@ const formatNumber = (num: number): string => {
|
||||
};
|
||||
|
||||
const YearOverYearChart: React.FC<{ data: MonthlyData[] }> = ({ data }) => {
|
||||
const { t } = useTranslation();
|
||||
const [tooltip, setTooltip] = useState<TooltipData | null>(null);
|
||||
const [isAnimated, setIsAnimated] = useState(false);
|
||||
|
||||
@@ -420,12 +422,12 @@ const YearOverYearChart: React.FC<{ data: MonthlyData[] }> = ({ data }) => {
|
||||
<div className="chart-tooltip-title">{tooltip.month}</div>
|
||||
<div className="chart-tooltip-row">
|
||||
<span className="chart-tooltip-dot mint"></span>
|
||||
<span className="chart-tooltip-label">올해</span>
|
||||
<span className="chart-tooltip-label">{t('dashboard.thisYear')}</span>
|
||||
<span className="chart-tooltip-value">{formatNumber(tooltip.thisYear)}</span>
|
||||
</div>
|
||||
<div className="chart-tooltip-row">
|
||||
<span className="chart-tooltip-dot purple"></span>
|
||||
<span className="chart-tooltip-label">작년</span>
|
||||
<span className="chart-tooltip-label">{t('dashboard.lastYear')}</span>
|
||||
<span className="chart-tooltip-value">{formatNumber(tooltip.lastYear)}</span>
|
||||
</div>
|
||||
<div className="chart-tooltip-change">
|
||||
@@ -517,6 +519,7 @@ const AudienceBarChart: React.FC<{ data: { label: string; percentage: number }[]
|
||||
};
|
||||
|
||||
const GenderChart: React.FC<{ male: number; female: number; delay?: number }> = ({ male, female, delay = 0 }) => {
|
||||
const { t } = useTranslation();
|
||||
const [isAnimated, setIsAnimated] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -535,8 +538,8 @@ const GenderChart: React.FC<{ male: number; female: number; delay?: number }> =
|
||||
</div>
|
||||
</div>
|
||||
<div className="gender-chart-labels">
|
||||
<span className="gender-label male">남성</span>
|
||||
<span className="gender-label female">여성</span>
|
||||
<span className="gender-label male">{t('dashboard.male')}</span>
|
||||
<span className="gender-label female">{t('dashboard.female')}</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
@@ -547,9 +550,97 @@ const GenderChart: React.FC<{ male: number; female: number; delay?: number }> =
|
||||
// =====================================================
|
||||
|
||||
const DashboardContent: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
const [selectedPlatform, setSelectedPlatform] = useState<'youtube' | 'instagram'>('youtube');
|
||||
|
||||
const currentPlatformData = PLATFORM_DATA.find(p => p.platform === selectedPlatform);
|
||||
// Translated content metrics
|
||||
const contentMetrics: ContentMetric[] = [
|
||||
{ id: 'impressions', label: t('dashboard.metricImpressions'), labelEn: 'IMPRESSIONS', value: '2.4M', trend: 12.5, trendDirection: 'up' },
|
||||
{ id: 'reach', label: t('dashboard.metricReach'), labelEn: 'REACH', value: '1.8M', trend: 9.2, trendDirection: 'up' },
|
||||
{ id: 'likes', label: t('dashboard.metricLikes'), labelEn: 'LIKES', value: '158.2K', trend: 8.3, trendDirection: 'up' },
|
||||
{ id: 'comments', label: t('dashboard.metricComments'), labelEn: 'COMMENTS', value: '24.9K', trend: 2.1, trendDirection: 'down' },
|
||||
{ id: 'shares', label: t('dashboard.metricShares'), labelEn: 'SHARES', value: '8.4K', trend: 15.7, trendDirection: 'up' },
|
||||
{ id: 'saves', label: t('dashboard.metricSaves'), labelEn: 'SAVES', value: '12.3K', trend: 22.4, trendDirection: 'up' },
|
||||
{ id: 'engagement', label: t('dashboard.metricEngagement'), labelEn: 'ENGAGEMENT', value: '4.8%', trend: 0.5, trendDirection: 'up' },
|
||||
{ id: 'content', label: t('dashboard.metricContent'), labelEn: 'CONTENT', value: '127', trend: 4, trendDirection: 'up' },
|
||||
];
|
||||
|
||||
// Translated monthly data
|
||||
const monthlyData: MonthlyData[] = [
|
||||
{ month: t('dashboard.months.jan'), thisYear: 180000, lastYear: 145000 },
|
||||
{ month: t('dashboard.months.feb'), thisYear: 195000, lastYear: 158000 },
|
||||
{ month: t('dashboard.months.mar'), thisYear: 210000, lastYear: 172000 },
|
||||
{ month: t('dashboard.months.apr'), thisYear: 185000, lastYear: 168000 },
|
||||
{ month: t('dashboard.months.may'), thisYear: 240000, lastYear: 195000 },
|
||||
{ month: t('dashboard.months.jun'), thisYear: 275000, lastYear: 210000 },
|
||||
{ month: t('dashboard.months.jul'), thisYear: 320000, lastYear: 235000 },
|
||||
{ month: t('dashboard.months.aug'), thisYear: 295000, lastYear: 248000 },
|
||||
{ month: t('dashboard.months.sep'), thisYear: 310000, lastYear: 262000 },
|
||||
{ month: t('dashboard.months.oct'), thisYear: 285000, lastYear: 255000 },
|
||||
{ month: t('dashboard.months.nov'), thisYear: 340000, lastYear: 278000 },
|
||||
{ month: t('dashboard.months.dec'), thisYear: 380000, lastYear: 295000 },
|
||||
];
|
||||
|
||||
// Translated platform data
|
||||
const platformData: PlatformData[] = [
|
||||
{
|
||||
platform: 'youtube',
|
||||
displayName: 'YouTube',
|
||||
metrics: [
|
||||
{ id: 'views', label: t('dashboard.youtubeMetrics.views'), value: '1.25M', trend: 18.2, trendDirection: 'up' },
|
||||
{ id: 'watchTime', label: t('dashboard.youtubeMetrics.watchTime'), value: '4,820', unit: t('dashboard.youtubeMetrics.watchTimeUnit'), trend: 12.5, trendDirection: 'up' },
|
||||
{ id: 'avgViewDuration', label: t('dashboard.youtubeMetrics.avgViewDuration'), value: '3:24', trend: 5.2, trendDirection: 'up' },
|
||||
{ id: 'subscribers', label: t('dashboard.youtubeMetrics.subscribers'), value: '45.2K', trend: 5.8, trendDirection: 'up' },
|
||||
{ id: 'newSubscribers', label: t('dashboard.youtubeMetrics.newSubscribers'), value: '1.2K', trend: 12.3, trendDirection: 'up' },
|
||||
{ id: 'engagement', label: t('dashboard.youtubeMetrics.engagement'), value: '4.8', unit: '%', trend: 0.3, trendDirection: 'up' },
|
||||
{ id: 'ctr', label: t('dashboard.youtubeMetrics.ctr'), value: '6.2', unit: '%', trend: 1.1, trendDirection: 'up' },
|
||||
{ id: 'revenue', label: t('dashboard.youtubeMetrics.revenue'), value: '₩2.4M', trend: 8.5, trendDirection: 'up' },
|
||||
],
|
||||
},
|
||||
{
|
||||
platform: 'instagram',
|
||||
displayName: 'Instagram',
|
||||
metrics: [
|
||||
{ id: 'reach', label: t('dashboard.instagramMetrics.reach'), value: '892K', trend: 22.4, trendDirection: 'up' },
|
||||
{ id: 'impressions', label: t('dashboard.instagramMetrics.impressions'), value: '1.58M', trend: 15.1, trendDirection: 'up' },
|
||||
{ id: 'profileVisits', label: t('dashboard.instagramMetrics.profileVisits'), value: '28.4K', trend: 18.7, trendDirection: 'up' },
|
||||
{ id: 'followers', label: t('dashboard.instagramMetrics.followers'), value: '28.5K', trend: 8.2, trendDirection: 'up' },
|
||||
{ id: 'newFollowers', label: t('dashboard.instagramMetrics.newFollowers'), value: '892', trend: 15.6, trendDirection: 'up' },
|
||||
{ id: 'storyViews', label: t('dashboard.instagramMetrics.storyViews'), value: '156K', trend: 3.2, trendDirection: 'down' },
|
||||
{ id: 'reelPlays', label: t('dashboard.instagramMetrics.reelPlays'), value: '423K', trend: 45.2, trendDirection: 'up' },
|
||||
{ id: 'websiteClicks', label: t('dashboard.instagramMetrics.websiteClicks'), value: '3.2K', trend: 11.8, trendDirection: 'up' },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
// Translated top content
|
||||
const topContent: TopContent[] = [
|
||||
{ id: '1', title: t('dashboard.topContentTitles.winterPromotion'), thumbnail: 'https://picsum.photos/seed/content1/120/68', platform: 'youtube', views: '125.4K', engagement: '8.2%', date: '2025.01.15' },
|
||||
{ id: '2', title: t('dashboard.topContentTitles.stayIntroReel'), thumbnail: 'https://picsum.photos/seed/content2/120/68', platform: 'instagram', views: '89.2K', engagement: '12.5%', date: '2025.01.22' },
|
||||
{ id: '3', title: t('dashboard.topContentTitles.newYearEvent'), thumbnail: 'https://picsum.photos/seed/content3/120/68', platform: 'youtube', views: '67.8K', engagement: '6.4%', date: '2025.01.08' },
|
||||
{ id: '4', title: t('dashboard.topContentTitles.nightTimelapse'), thumbnail: 'https://picsum.photos/seed/content4/120/68', platform: 'instagram', views: '54.3K', engagement: '15.8%', date: '2025.01.28' },
|
||||
];
|
||||
|
||||
// Translated audience data
|
||||
const audienceData: AudienceData = {
|
||||
ageGroups: [
|
||||
{ label: '18-24', percentage: 12 },
|
||||
{ label: '25-34', percentage: 35 },
|
||||
{ label: '35-44', percentage: 28 },
|
||||
{ label: '45-54', percentage: 18 },
|
||||
{ label: '55+', percentage: 7 },
|
||||
],
|
||||
gender: { male: 42, female: 58 },
|
||||
topRegions: [
|
||||
{ region: t('dashboard.regions.seoul'), percentage: 32 },
|
||||
{ region: t('dashboard.regions.gyeonggi'), percentage: 24 },
|
||||
{ region: t('dashboard.regions.busan'), percentage: 12 },
|
||||
{ region: t('dashboard.regions.incheon'), percentage: 8 },
|
||||
{ region: t('dashboard.regions.daegu'), percentage: 6 },
|
||||
],
|
||||
};
|
||||
|
||||
const currentPlatformData = platformData.find(p => p.platform === selectedPlatform);
|
||||
const lastUpdated = new Date().toLocaleDateString('ko-KR', {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
@@ -564,18 +655,18 @@ const DashboardContent: React.FC = () => {
|
||||
<AnimatedSection delay={0}>
|
||||
<div className="dashboard-header-row">
|
||||
<div>
|
||||
<h1 className="dashboard-title">대시보드</h1>
|
||||
<p className="dashboard-description">실시간 마케팅 퍼포먼스를 확인하세요.</p>
|
||||
<h1 className="dashboard-title">{t('dashboard.title')}</h1>
|
||||
<p className="dashboard-description">{t('dashboard.description')}</p>
|
||||
</div>
|
||||
<span className="dashboard-last-updated">마지막 업데이트: {lastUpdated}</span>
|
||||
<span className="dashboard-last-updated">{t('dashboard.lastUpdated')} {lastUpdated}</span>
|
||||
</div>
|
||||
</AnimatedSection>
|
||||
|
||||
{/* Content Performance Section */}
|
||||
<AnimatedSection delay={100} className="dashboard-section">
|
||||
<h2 className="dashboard-section-title">콘텐츠 성과</h2>
|
||||
<h2 className="dashboard-section-title">{t('dashboard.contentPerformance')}</h2>
|
||||
<div className="stats-grid-8">
|
||||
{CONTENT_METRICS.map((metric, index) => (
|
||||
{contentMetrics.map((metric, index) => (
|
||||
<AnimatedItem key={metric.id} index={index} baseDelay={200}>
|
||||
<StatCard {...metric} />
|
||||
</AnimatedItem>
|
||||
@@ -589,23 +680,23 @@ const DashboardContent: React.FC = () => {
|
||||
<AnimatedSection delay={600}>
|
||||
<div className="yoy-chart-card">
|
||||
<div className="yoy-chart-header">
|
||||
<h2 className="dashboard-section-title">전년 대비 성장</h2>
|
||||
<h2 className="dashboard-section-title">{t('dashboard.yearOverYear')}</h2>
|
||||
<div className="chart-legend-dual">
|
||||
<div className="chart-legend-item">
|
||||
<span className="chart-legend-line solid"></span>
|
||||
<span className="chart-legend-text">올해</span>
|
||||
<span className="chart-legend-text">{t('dashboard.thisYear')}</span>
|
||||
</div>
|
||||
<div className="chart-legend-item">
|
||||
<span className="chart-legend-line dashed"></span>
|
||||
<span className="chart-legend-text">작년</span>
|
||||
<span className="chart-legend-text">{t('dashboard.lastYear')}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="yoy-chart-container">
|
||||
<YearOverYearChart data={MONTHLY_DATA} />
|
||||
<YearOverYearChart data={monthlyData} />
|
||||
</div>
|
||||
<div className="yoy-chart-xaxis">
|
||||
{MONTHLY_DATA.map(d => (
|
||||
{monthlyData.map(d => (
|
||||
<span key={d.month}>{d.month}</span>
|
||||
))}
|
||||
</div>
|
||||
@@ -615,9 +706,9 @@ const DashboardContent: React.FC = () => {
|
||||
{/* Top Content Section */}
|
||||
<AnimatedSection delay={700}>
|
||||
<div className="top-content-card">
|
||||
<h2 className="dashboard-section-title">인기 콘텐츠</h2>
|
||||
<h2 className="dashboard-section-title">{t('dashboard.popularContent')}</h2>
|
||||
<div className="top-content-list">
|
||||
{TOP_CONTENT.map((content, index) => (
|
||||
{topContent.map((content, index) => (
|
||||
<AnimatedItem key={content.id} index={index} baseDelay={800}>
|
||||
<TopContentItem {...content} />
|
||||
</AnimatedItem>
|
||||
@@ -629,24 +720,24 @@ const DashboardContent: React.FC = () => {
|
||||
|
||||
{/* Audience Insights Section */}
|
||||
<AnimatedSection delay={1000} className="audience-section">
|
||||
<h2 className="dashboard-section-title">오디언스 인사이트</h2>
|
||||
<h2 className="dashboard-section-title">{t('dashboard.audienceInsights')}</h2>
|
||||
<div className="audience-cards">
|
||||
<AnimatedItem index={0} baseDelay={1100}>
|
||||
<div className="audience-card">
|
||||
<h3 className="audience-card-title">연령대 분포</h3>
|
||||
<AudienceBarChart data={AUDIENCE_DATA.ageGroups} delay={1200} />
|
||||
<h3 className="audience-card-title">{t('dashboard.ageDistribution')}</h3>
|
||||
<AudienceBarChart data={audienceData.ageGroups} delay={1200} />
|
||||
</div>
|
||||
</AnimatedItem>
|
||||
<AnimatedItem index={1} baseDelay={1100}>
|
||||
<div className="audience-card">
|
||||
<h3 className="audience-card-title">성별 분포</h3>
|
||||
<GenderChart male={AUDIENCE_DATA.gender.male} female={AUDIENCE_DATA.gender.female} delay={1300} />
|
||||
<h3 className="audience-card-title">{t('dashboard.genderDistribution')}</h3>
|
||||
<GenderChart male={audienceData.gender.male} female={audienceData.gender.female} delay={1300} />
|
||||
</div>
|
||||
</AnimatedItem>
|
||||
<AnimatedItem index={2} baseDelay={1100}>
|
||||
<div className="audience-card">
|
||||
<h3 className="audience-card-title">상위 지역</h3>
|
||||
<AudienceBarChart data={AUDIENCE_DATA.topRegions.map(r => ({ label: r.region, percentage: r.percentage }))} delay={1400} />
|
||||
<h3 className="audience-card-title">{t('dashboard.topRegions')}</h3>
|
||||
<AudienceBarChart data={audienceData.topRegions.map(r => ({ label: r.region, percentage: r.percentage }))} delay={1400} />
|
||||
</div>
|
||||
</AnimatedItem>
|
||||
</div>
|
||||
@@ -656,7 +747,7 @@ const DashboardContent: React.FC = () => {
|
||||
<AnimatedSection delay={1300}>
|
||||
<div className="platform-section-card">
|
||||
<div className="platform-section-header">
|
||||
<h2 className="dashboard-section-title">플랫폼별 지표</h2>
|
||||
<h2 className="dashboard-section-title">{t('dashboard.platformMetrics')}</h2>
|
||||
<div className="platform-tabs">
|
||||
<button
|
||||
className={`platform-tab ${selectedPlatform === 'youtube' ? 'active' : ''}`}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import Sidebar from '../../components/Sidebar';
|
||||
import AssetManagementContent from './AssetManagementContent';
|
||||
import SoundStudioContent from './SoundStudioContent';
|
||||
@@ -64,6 +65,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
businessInfo,
|
||||
initialAnalysisData
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
// localStorage에서 저장된 상태 복원
|
||||
const savedActiveItem = localStorage.getItem(ACTIVE_ITEM_KEY);
|
||||
const savedWizardStep = localStorage.getItem(WIZARD_STEP_KEY);
|
||||
@@ -212,7 +214,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
goToWizardStep(0); // 브랜드 분석 결과로
|
||||
} catch (err) {
|
||||
console.error('Autocomplete error:', err);
|
||||
setAnalysisError(err instanceof Error ? err.message : '업체 정보 조회에 실패했습니다.');
|
||||
setAnalysisError(err instanceof Error ? err.message : t('app.autocompleteError'));
|
||||
goToWizardStep(-2); // URL 입력으로 돌아가기
|
||||
}
|
||||
};
|
||||
@@ -252,7 +254,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
goToWizardStep(0); // 브랜드 분석 결과로
|
||||
} catch (err) {
|
||||
console.error('Crawling failed:', err);
|
||||
const errorMessage = err instanceof Error ? err.message : '분석 중 오류가 발생했습니다. 다시 시도해주세요.';
|
||||
const errorMessage = err instanceof Error ? err.message : t('app.analysisError');
|
||||
setAnalysisError(errorMessage);
|
||||
goToWizardStep(-2); // URL 입력으로 돌아가기
|
||||
}
|
||||
@@ -403,7 +405,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
|
||||
default:
|
||||
return (
|
||||
<div className="flex-1 flex items-center justify-center text-gray-500 font-light">
|
||||
{activeItem} 페이지 준비 중입니다.
|
||||
{t('app.pageComingSoon', { page: activeItem })}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { getSocialAccounts, getYouTubeConnectUrl, disconnectSocialAccount, TokenExpiredError, handleSocialReconnect } from '../../utils/api';
|
||||
import { SocialAccount } from '../../types/api';
|
||||
|
||||
type TabType = 'basic' | 'payment' | 'business';
|
||||
|
||||
const MyInfoContent: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
const [activeTab, setActiveTab] = useState<TabType>('business');
|
||||
const [businessUrl, setBusinessUrl] = useState('');
|
||||
const [socialAccounts, setSocialAccounts] = useState<SocialAccount[]>([]);
|
||||
@@ -24,7 +26,7 @@ const MyInfoContent: React.FC = () => {
|
||||
setSocialAccounts(response.accounts || []);
|
||||
} catch (error) {
|
||||
if (error instanceof TokenExpiredError) {
|
||||
alert('YouTube 인증이 만료되었습니다. 재연동 페이지로 이동합니다.');
|
||||
alert(t('myInfo.youtubeExpiredAlert'));
|
||||
handleSocialReconnect(error.reconnectUrl);
|
||||
return;
|
||||
}
|
||||
@@ -42,7 +44,7 @@ const MyInfoContent: React.FC = () => {
|
||||
window.location.href = response.auth_url;
|
||||
} catch (error) {
|
||||
if (error instanceof TokenExpiredError) {
|
||||
alert('YouTube 인증이 만료되었습니다. 재연동 페이지로 이동합니다.');
|
||||
alert(t('myInfo.youtubeExpiredAlert'));
|
||||
handleSocialReconnect(error.reconnectUrl);
|
||||
return;
|
||||
}
|
||||
@@ -58,7 +60,7 @@ const MyInfoContent: React.FC = () => {
|
||||
setSocialAccounts(prev => prev.filter(acc => acc.id !== accountId));
|
||||
} catch (error) {
|
||||
if (error instanceof TokenExpiredError) {
|
||||
alert('YouTube 인증이 만료되었습니다. 재연동 페이지로 이동합니다.');
|
||||
alert(t('myInfo.youtubeExpiredAlert'));
|
||||
handleSocialReconnect(error.reconnectUrl);
|
||||
return;
|
||||
}
|
||||
@@ -76,14 +78,14 @@ const MyInfoContent: React.FC = () => {
|
||||
const hasConnectedAccounts = youtubeAccounts.length > 0 || instagramAccounts.length > 0;
|
||||
|
||||
const tabs = [
|
||||
{ id: 'basic' as TabType, label: '기본 정보' },
|
||||
{ id: 'payment' as TabType, label: '결제 정보' },
|
||||
{ id: 'business' as TabType, label: '내 비즈니스 & 소셜 채널 관리' },
|
||||
{ id: 'basic' as TabType, label: t('myInfo.tabBasic') },
|
||||
{ id: 'payment' as TabType, label: t('myInfo.tabPayment') },
|
||||
{ id: 'business' as TabType, label: t('myInfo.tabBusiness') },
|
||||
];
|
||||
|
||||
return (
|
||||
<main className="myinfo-page">
|
||||
<h1 className="myinfo-title">내 정보</h1>
|
||||
<h1 className="myinfo-title">{t('myInfo.title')}</h1>
|
||||
|
||||
{/* 탭 네비게이션 */}
|
||||
<div className="myinfo-tabs">
|
||||
@@ -102,13 +104,13 @@ const MyInfoContent: React.FC = () => {
|
||||
<div className="myinfo-content">
|
||||
{activeTab === 'basic' && (
|
||||
<div className="myinfo-section">
|
||||
<p className="myinfo-placeholder">기본 정보 설정 기능이 준비 중입니다.</p>
|
||||
<p className="myinfo-placeholder">{t('myInfo.basicPlaceholder')}</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{activeTab === 'payment' && (
|
||||
<div className="myinfo-section">
|
||||
<p className="myinfo-placeholder">결제 정보 설정 기능이 준비 중입니다.</p>
|
||||
<p className="myinfo-placeholder">{t('myInfo.paymentPlaceholder')}</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -116,22 +118,22 @@ const MyInfoContent: React.FC = () => {
|
||||
<>
|
||||
{/* 내 비즈니스 섹션 */}
|
||||
<div className="myinfo-section">
|
||||
<h2 className="myinfo-section-title">내 비즈니스</h2>
|
||||
<h2 className="myinfo-section-title">{t('myInfo.myBusiness')}</h2>
|
||||
<div className="myinfo-business-card">
|
||||
<h3 className="myinfo-business-empty-title">아직 등록된 비즈니스가 없어요</h3>
|
||||
<h3 className="myinfo-business-empty-title">{t('myInfo.noBusinessTitle')}</h3>
|
||||
<p className="myinfo-business-empty-desc">
|
||||
네이버 지도 URL을 입력하면, 영상 제작에 필요한 정보를 자동으로 불러와요
|
||||
{t('myInfo.noBusinessDesc')}
|
||||
</p>
|
||||
<div className="myinfo-business-input-row">
|
||||
<input
|
||||
type="text"
|
||||
value={businessUrl}
|
||||
onChange={(e) => setBusinessUrl(e.target.value)}
|
||||
placeholder="네이버 지도 URL 입력"
|
||||
placeholder={t('myInfo.naverMapUrlPlaceholder')}
|
||||
className="myinfo-business-input"
|
||||
/>
|
||||
<button className="myinfo-business-submit">
|
||||
비즈니스 등록
|
||||
{t('myInfo.registerBusiness')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -139,7 +141,7 @@ const MyInfoContent: React.FC = () => {
|
||||
|
||||
{/* 소셜 채널 섹션 */}
|
||||
<div className="myinfo-section">
|
||||
<h2 className="myinfo-section-title">소셜 채널</h2>
|
||||
<h2 className="myinfo-section-title">{t('myInfo.socialChannels')}</h2>
|
||||
|
||||
{/* 연결 버튼들 (가로 배치) */}
|
||||
<div className="myinfo-social-buttons">
|
||||
@@ -149,7 +151,7 @@ const MyInfoContent: React.FC = () => {
|
||||
className={`myinfo-social-btn ${youtubeAccounts.length > 0 ? 'connected' : ''}`}
|
||||
>
|
||||
<img src="/assets/images/social-youtube.png" alt="YouTube" className="myinfo-social-btn-icon" />
|
||||
<span>{isConnecting === 'youtube' ? '연결 중...' : 'YouTube 연결'}</span>
|
||||
<span>{isConnecting === 'youtube' ? t('myInfo.youtubeConnecting') : t('myInfo.youtubeConnect')}</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
@@ -157,7 +159,7 @@ const MyInfoContent: React.FC = () => {
|
||||
className="myinfo-social-btn disabled"
|
||||
>
|
||||
<img src="/assets/images/social-instagram.png" alt="Instagram" className="myinfo-social-btn-icon" />
|
||||
<span>Instagram 연결</span>
|
||||
<span>{t('myInfo.instagramConnect')}</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -189,13 +191,13 @@ const MyInfoContent: React.FC = () => {
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<polyline points="20 6 9 17 4 12" />
|
||||
</svg>
|
||||
연결됨
|
||||
{t('myInfo.connected')}
|
||||
</span>
|
||||
<button
|
||||
onClick={() => handleDisconnectAccount(account.id)}
|
||||
className="myinfo-connected-disconnect"
|
||||
>
|
||||
연결 해제
|
||||
{t('myInfo.disconnectAccount')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -226,13 +228,13 @@ const MyInfoContent: React.FC = () => {
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
||||
<polyline points="20 6 9 17 4 12" />
|
||||
</svg>
|
||||
연결됨
|
||||
{t('myInfo.connected')}
|
||||
</span>
|
||||
<button
|
||||
onClick={() => handleDisconnectAccount(account.id)}
|
||||
className="myinfo-connected-disconnect"
|
||||
>
|
||||
연결 해제
|
||||
{t('myInfo.disconnectAccount')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -241,7 +243,7 @@ const MyInfoContent: React.FC = () => {
|
||||
)}
|
||||
|
||||
{isLoadingAccounts && (
|
||||
<p className="myinfo-loading">계정 정보를 불러오는 중...</p>
|
||||
<p className="myinfo-loading">{t('myInfo.loadingAccounts')}</p>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
import React, { useState, useRef, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { generateLyric, waitForLyricComplete, generateSong, waitForSongComplete } from '../../utils/api';
|
||||
import { LANGUAGE_MAP } from '../../types/api';
|
||||
|
||||
@@ -39,6 +40,7 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
videoGenerationStatus = 'idle',
|
||||
videoGenerationProgress = 0
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const [selectedType, setSelectedType] = useState('보컬');
|
||||
const [selectedLang, setSelectedLang] = useState('한국어');
|
||||
const [selectedGenre, setSelectedGenre] = useState('자동 선택');
|
||||
@@ -94,15 +96,15 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
songId,
|
||||
(pollStatus: string) => {
|
||||
if (pollStatus === 'streaming') {
|
||||
setStatusMessage('노래를 생성하고 있습니다...');
|
||||
setStatusMessage(t('soundStudio.generatingSong'));
|
||||
} else if (pollStatus === 'queued') {
|
||||
setStatusMessage('노래 생성 대기 중...');
|
||||
setStatusMessage(t('soundStudio.songQueued'));
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
if (!statusResponse.success) {
|
||||
throw new Error(statusResponse.error_message || '음악 생성에 실패했습니다.');
|
||||
throw new Error(statusResponse.error_message || t('soundStudio.musicGenerationFailed'));
|
||||
}
|
||||
|
||||
// song_result_url을 사용하여 재생
|
||||
@@ -120,16 +122,16 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
if (currentRetryCount < MAX_RETRY_COUNT) {
|
||||
const newRetryCount = currentRetryCount + 1;
|
||||
setRetryCount(newRetryCount);
|
||||
setStatusMessage(`시간 초과로 재생성 중... (${newRetryCount}/${MAX_RETRY_COUNT})`);
|
||||
setStatusMessage(t('soundStudio.retryMessage', { count: newRetryCount, max: MAX_RETRY_COUNT }));
|
||||
await regenerateSongOnly(currentLyrics, newRetryCount);
|
||||
} else {
|
||||
setStatus('error');
|
||||
setErrorMessage('여러 번 시도했지만 음악 생성에 실패했습니다. 다시 시도해주세요.');
|
||||
setErrorMessage(t('soundStudio.multipleRetryFailed'));
|
||||
setRetryCount(0);
|
||||
}
|
||||
} else {
|
||||
setStatus('error');
|
||||
setErrorMessage(error instanceof Error ? error.message : '음악 생성 중 오류가 발생했습니다.');
|
||||
setErrorMessage(error instanceof Error ? error.message : t('soundStudio.musicGenerationError'));
|
||||
setRetryCount(0);
|
||||
}
|
||||
}
|
||||
@@ -158,7 +160,7 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
});
|
||||
|
||||
if (!songResponse.success) {
|
||||
throw new Error(songResponse.error_message || '음악 생성 요청에 실패했습니다.');
|
||||
throw new Error(songResponse.error_message || t('soundStudio.songGenerationFailed'));
|
||||
}
|
||||
|
||||
await resumePolling(songResponse.task_id, songResponse.song_id, currentLyrics, currentRetryCount);
|
||||
@@ -166,7 +168,7 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
} catch (error) {
|
||||
console.error('Song regeneration failed:', error);
|
||||
setStatus('error');
|
||||
setErrorMessage(error instanceof Error ? error.message : '음악 재생성 중 오류가 발생했습니다.');
|
||||
setErrorMessage(error instanceof Error ? error.message : t('soundStudio.songRegenerationError'));
|
||||
setRetryCount(0);
|
||||
}
|
||||
};
|
||||
@@ -256,18 +258,18 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
|
||||
const handleGenerateMusic = async () => {
|
||||
if (!businessInfo) {
|
||||
setErrorMessage('비즈니스 정보가 없습니다. 다시 시도해주세요.');
|
||||
setErrorMessage(t('soundStudio.noBusinessInfo'));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!imageTaskId) {
|
||||
setErrorMessage('이미지 업로드 정보가 없습니다. 이전 단계로 돌아가 다시 시도해주세요.');
|
||||
setErrorMessage(t('soundStudio.noImageUploadInfo'));
|
||||
return;
|
||||
}
|
||||
|
||||
setStatus('generating_lyric');
|
||||
setErrorMessage(null);
|
||||
setStatusMessage('가사를 생성하고 있습니다...');
|
||||
setStatusMessage(t('soundStudio.generatingLyrics'));
|
||||
|
||||
try {
|
||||
const language = LANGUAGE_MAP[selectedLang] || 'Korean';
|
||||
@@ -282,33 +284,33 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
});
|
||||
|
||||
if (!lyricResponse.success || !lyricResponse.task_id) {
|
||||
throw new Error(lyricResponse.error_message || '가사 생성 요청에 실패했습니다.');
|
||||
throw new Error(lyricResponse.error_message || t('soundStudio.lyricGenerationFailed'));
|
||||
}
|
||||
|
||||
// 2. 가사 생성 상태 폴링 → 완료 시 상세 조회
|
||||
setStatusMessage('가사를 생성하고 있습니다...');
|
||||
setStatusMessage(t('soundStudio.generatingLyrics'));
|
||||
const lyricDetailResponse = await waitForLyricComplete(
|
||||
lyricResponse.task_id,
|
||||
(status: string) => {
|
||||
if (status === 'processing') {
|
||||
setStatusMessage('가사를 생성하고 있습니다...');
|
||||
setStatusMessage(t('soundStudio.generatingLyrics'));
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
if (!lyricDetailResponse.lyric_result) {
|
||||
throw new Error('가사를 받지 못했습니다.');
|
||||
throw new Error(t('soundStudio.lyricNotReceived'));
|
||||
}
|
||||
|
||||
// "I'm sorry" 체크
|
||||
if (lyricDetailResponse.lyric_result.includes("I'm sorry")) {
|
||||
throw new Error('가사 생성에 실패했습니다. 다시 시도해주세요.');
|
||||
throw new Error(t('soundStudio.lyricGenerationError'));
|
||||
}
|
||||
|
||||
setLyrics(lyricDetailResponse.lyric_result);
|
||||
|
||||
setStatus('generating_song');
|
||||
setStatusMessage('노래를 생성하고 있습니다...');
|
||||
setStatusMessage(t('soundStudio.generatingSong'));
|
||||
|
||||
const genreMap: Record<string, string> = {
|
||||
'자동 선택': 'pop',
|
||||
@@ -328,7 +330,7 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
});
|
||||
|
||||
if (!songResponse.success) {
|
||||
throw new Error(songResponse.error_message || '음악 생성 요청에 실패했습니다.');
|
||||
throw new Error(songResponse.error_message || t('soundStudio.songGenerationFailed'));
|
||||
}
|
||||
|
||||
// 디버깅: songResponse 확인
|
||||
@@ -337,18 +339,18 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
console.log('task_id:', songResponse.task_id);
|
||||
|
||||
if (!songResponse.song_id) {
|
||||
throw new Error('서버에서 song_id를 받지 못했습니다.');
|
||||
throw new Error(t('soundStudio.songIdMissing'));
|
||||
}
|
||||
|
||||
setStatus('polling');
|
||||
setStatusMessage('노래를 생성하고 있습니다...');
|
||||
setStatusMessage(t('soundStudio.generatingSong'));
|
||||
|
||||
await resumePolling(songResponse.task_id, songResponse.song_id, lyricDetailResponse.lyric_result, 0);
|
||||
|
||||
} catch (error) {
|
||||
console.error('Music generation failed:', error);
|
||||
setStatus('error');
|
||||
setErrorMessage(error instanceof Error ? error.message : '음악 생성 중 오류가 발생했습니다.');
|
||||
setErrorMessage(error instanceof Error ? error.message : t('soundStudio.musicGenerationError'));
|
||||
setRetryCount(0);
|
||||
}
|
||||
};
|
||||
@@ -378,34 +380,38 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<path d="M15 18l-6-6 6-6" />
|
||||
</svg>
|
||||
뒤로가기
|
||||
{t('soundStudio.back')}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Page Title */}
|
||||
<h1 className="sound-studio-title">사운드 스튜디오</h1>
|
||||
<h1 className="sound-studio-title">{t('soundStudio.title')}</h1>
|
||||
|
||||
{/* Main Content - Two Column Layout */}
|
||||
<div className="sound-studio-container">
|
||||
<div className="sound-studio-columns">
|
||||
{/* Left Column - Sound Settings */}
|
||||
<div className="sound-column">
|
||||
<h3 className="column-title">사운드</h3>
|
||||
<h3 className="column-title">{t('soundStudio.soundColumn')}</h3>
|
||||
|
||||
{/* Sound Type Selection */}
|
||||
<div className="sound-studio-section">
|
||||
<label className="input-label">AI 사운드 유형 선택</label>
|
||||
<label className="input-label">{t('soundStudio.soundTypeLabel')}</label>
|
||||
<div className="sound-type-grid">
|
||||
{['보컬', '배경음악', '성우 내레이션'].map(type => {
|
||||
const isDisabled = type === '성우 내레이션' || isGenerating;
|
||||
{[
|
||||
{ key: '보컬', label: t('soundStudio.soundTypeVocal') },
|
||||
{ key: '배경음악', label: t('soundStudio.soundTypeBGM') },
|
||||
{ key: '성우 내레이션', label: t('soundStudio.soundTypeNarration') },
|
||||
].map(({ key, label }) => {
|
||||
const isDisabled = key === '성우 내레이션' || isGenerating;
|
||||
return (
|
||||
<button
|
||||
key={type}
|
||||
onClick={() => !isDisabled && setSelectedType(type)}
|
||||
key={key}
|
||||
onClick={() => !isDisabled && setSelectedType(key)}
|
||||
disabled={isDisabled}
|
||||
className={`sound-type-btn ${selectedType === type ? 'active' : ''} ${type === '성우 내레이션' ? 'permanently-disabled' : ''}`}
|
||||
className={`sound-type-btn ${selectedType === key ? 'active' : ''} ${key === '성우 내레이션' ? 'permanently-disabled' : ''}`}
|
||||
>
|
||||
{type}
|
||||
{label}
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
@@ -414,17 +420,21 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
|
||||
{/* Genre Selection */}
|
||||
<div className="sound-studio-section">
|
||||
<label className="input-label">장르 선택</label>
|
||||
<label className="input-label">{t('soundStudio.genreLabel')}</label>
|
||||
<div className="genre-grid">
|
||||
<div className="genre-row">
|
||||
{['자동 선택', 'K-POP', '발라드'].map(genre => (
|
||||
{[
|
||||
{ key: '자동 선택', label: t('soundStudio.genreAuto') },
|
||||
{ key: 'K-POP', label: 'K-POP' },
|
||||
{ key: '발라드', label: t('soundStudio.genreBallad') },
|
||||
].map(({ key, label }) => (
|
||||
<button
|
||||
key={genre}
|
||||
onClick={() => setSelectedGenre(genre)}
|
||||
key={key}
|
||||
onClick={() => setSelectedGenre(key)}
|
||||
disabled={isGenerating}
|
||||
className={`genre-btn ${selectedGenre === genre ? 'active' : ''}`}
|
||||
className={`genre-btn ${selectedGenre === key ? 'active' : ''}`}
|
||||
>
|
||||
{genre}
|
||||
{label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
@@ -458,7 +468,7 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
|
||||
{/* Language Selection */}
|
||||
<div className="sound-studio-section">
|
||||
<label className="input-label">언어</label>
|
||||
<label className="input-label">{t('soundStudio.languageLabel')}</label>
|
||||
<div className="language-selector-wrapper" ref={languageDropdownRef}>
|
||||
<button
|
||||
onClick={() => setIsLanguageDropdownOpen(!isLanguageDropdownOpen)}
|
||||
@@ -499,8 +509,8 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
{/* Right Column - Lyrics */}
|
||||
<div className="lyrics-column">
|
||||
<div className="lyrics-header">
|
||||
<h3 className="column-title">가사</h3>
|
||||
<p className="lyrics-subtitle">가사 영역을 선택해서 수정 가능해요</p>
|
||||
<h3 className="column-title">{t('soundStudio.lyricsColumn')}</h3>
|
||||
<p className="lyrics-subtitle">{t('soundStudio.lyricsHint')}</p>
|
||||
</div>
|
||||
|
||||
{/* Audio Player */}
|
||||
@@ -545,11 +555,11 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
value={lyrics}
|
||||
onChange={(e) => setLyrics(e.target.value)}
|
||||
className="lyrics-textarea"
|
||||
placeholder="사운드 생성 시 가사 표시됩니다."
|
||||
placeholder={t('soundStudio.lyricsPlaceholder')}
|
||||
/>
|
||||
) : (
|
||||
<div className="lyrics-placeholder">
|
||||
사운드 생성 시 가사 표시됩니다.
|
||||
{t('soundStudio.lyricsPlaceholder')}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -568,10 +578,10 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4" fill="none"/>
|
||||
<path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"/>
|
||||
</svg>
|
||||
생성 중...
|
||||
{t('soundStudio.generating')}
|
||||
</>
|
||||
) : (
|
||||
'사운드 생성'
|
||||
t('soundStudio.generateButton')
|
||||
)}
|
||||
</button>
|
||||
|
||||
@@ -607,7 +617,7 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
>
|
||||
{videoGenerationStatus === 'generating' ? (
|
||||
<>
|
||||
<span className="video-gen-text">영상 생성 중</span>
|
||||
<span className="video-gen-text">{t('soundStudio.videoGenerating')}</span>
|
||||
<div className="video-gen-progress-bar">
|
||||
<div
|
||||
className="video-gen-progress-fill"
|
||||
@@ -616,7 +626,7 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
'영상 생성하기'
|
||||
t('soundStudio.generateVideo')
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
import React, { useState, useRef, useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { searchAccommodation, AccommodationSearchItem, AutocompleteRequest } from '../../utils/api';
|
||||
import { CrawlingResponse } from '../../types/api';
|
||||
|
||||
@@ -16,6 +17,7 @@ interface UrlInputContentProps {
|
||||
}
|
||||
|
||||
const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomplete, onTestData, error }) => {
|
||||
const { t } = useTranslation();
|
||||
const [inputValue, setInputValue] = useState('');
|
||||
const [searchType, setSearchType] = useState<SearchType>('url');
|
||||
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
||||
@@ -45,19 +47,19 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomp
|
||||
|
||||
const searchTypeOptions = [
|
||||
{ value: 'url' as SearchType, label: 'URL' },
|
||||
{ value: 'name' as SearchType, label: '업체명' },
|
||||
{ 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'
|
||||
? 'URL에서 가져온 정보로 영상이 자동 생성됩니다.'
|
||||
: '업체명으로 검색하여 정보를 가져옵니다.';
|
||||
? t('urlInput.guideUrl')
|
||||
: t('urlInput.guideBusinessName');
|
||||
};
|
||||
|
||||
// 업체명 검색 시 자동완성 (디바운스 적용)
|
||||
@@ -222,7 +224,7 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomp
|
||||
{showAutocomplete && searchType === 'name' && (
|
||||
<div className="url-input-autocomplete-dropdown">
|
||||
{isAutocompleteLoading ? (
|
||||
<div className="url-input-autocomplete-loading">검색 중...</div>
|
||||
<div className="url-input-autocomplete-loading">{t('urlInput.searching')}</div>
|
||||
) : (
|
||||
autocompleteResults.map((item, index) => (
|
||||
<button
|
||||
@@ -245,7 +247,7 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomp
|
||||
|
||||
{/* 검색 버튼 */}
|
||||
<button type="submit" className="url-input-button">
|
||||
검색하기
|
||||
{t('urlInput.searchButton')}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -268,7 +270,7 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomp
|
||||
disabled={isLoadingTest}
|
||||
className="test-data-button"
|
||||
>
|
||||
{isLoadingTest ? '로딩 중...' : '테스트 데이터'}
|
||||
{isLoadingTest ? t('urlInput.testDataLoading') : t('urlInput.testData')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user