브랜드 분석, 콘텐츠 완료 페이지 수정 .
This commit is contained in:
1 parent
b89cf027af
commit
e448d8189d
12 files changed
+1456
-689
No files matched your search
@@ -64,6 +64,17 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
const audioRef = useRef<HTMLAudioElement>(null);
|
||||
const languageDropdownRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
// 완료 데이터를 localStorage에 저장
|
||||
const saveSongCompletionData = () => {
|
||||
const completionData = {
|
||||
businessName: businessInfo?.customer_name || '알 수 없음',
|
||||
genre: selectedGenre === '자동 선택' ? 'K-POP' : selectedGenre,
|
||||
lyrics: lyrics,
|
||||
timestamp: Date.now(),
|
||||
};
|
||||
localStorage.setItem('castad_song_completion', JSON.stringify(completionData));
|
||||
};
|
||||
|
||||
// Close language dropdown when clicking outside
|
||||
useEffect(() => {
|
||||
const handleClickOutside = (event: MouseEvent) => {
|
||||
@@ -84,6 +95,8 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
// Auto-navigate to next page when video generation is complete
|
||||
useEffect(() => {
|
||||
if (videoGenerationStatus === 'complete' && songTaskId) {
|
||||
// Save completion data before navigating
|
||||
saveSongCompletionData();
|
||||
// Wait a brief moment to show 100% completion before navigating
|
||||
const timer = setTimeout(() => {
|
||||
onNext(songTaskId);
|
||||
@@ -277,6 +290,7 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
const language = LANGUAGE_MAP[selectedLang] || 'Korean';
|
||||
|
||||
// 1. 가사 생성 요청
|
||||
console.log('[SoundStudio] Sending m_id:', mId);
|
||||
const lyricResponse = await generateLyric({
|
||||
customer_name: businessInfo.customer_name,
|
||||
detail_region_info: businessInfo.detail_region_info,
|
||||
@@ -404,20 +418,16 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
{[
|
||||
{ key: '보컬', label: t('soundStudio.soundTypeVocal') },
|
||||
{ key: '배경음악', label: t('soundStudio.soundTypeBGM') },
|
||||
{ key: '성우 내레이션', label: t('soundStudio.soundTypeNarration') },
|
||||
].map(({ key, label }) => {
|
||||
const isDisabled = key === '성우 내레이션' || isGenerating;
|
||||
return (
|
||||
].map(({ key, label }) => (
|
||||
<button
|
||||
key={key}
|
||||
onClick={() => !isDisabled && setSelectedType(key)}
|
||||
disabled={isDisabled}
|
||||
className={`sound-type-btn ${selectedType === key ? 'active' : ''} ${key === '성우 내레이션' ? 'permanently-disabled' : ''}`}
|
||||
onClick={() => !isGenerating && setSelectedType(key)}
|
||||
disabled={isGenerating}
|
||||
className={`sound-type-btn ${selectedType === key ? 'active' : ''}`}
|
||||
>
|
||||
{label}
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -608,7 +618,12 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
|
||||
{/* Bottom Button */}
|
||||
<div className="bottom-button-container">
|
||||
<button
|
||||
onClick={() => songTaskId && onNext(songTaskId)}
|
||||
onClick={() => {
|
||||
if (songTaskId) {
|
||||
saveSongCompletionData();
|
||||
onNext(songTaskId);
|
||||
}
|
||||
}}
|
||||
disabled={status !== 'complete' || !songTaskId || videoGenerationStatus === 'generating'}
|
||||
className={`btn-video-generate ${
|
||||
videoGenerationStatus === 'generating'
|
||||
|
||||
Reference in new issue
Block a user