가사 노출 형식 변경
This commit is contained in:
1 parent
a155a98767
commit
0a055a605c
2 files changed
+46
-5
No files matched your search
@@ -483,11 +483,31 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
|
||||
<div className="comp2-meta-divider"></div>
|
||||
<div className="comp2-lyrics-section">
|
||||
<span className="comp2-meta-label">{t('completion.lyrics')}</span>
|
||||
<p className="comp2-lyrics-text">
|
||||
{songCompletionData
|
||||
? (songCompletionData.lyrics || t('completion.noLyricsBGM'))
|
||||
: t('completion.sampleLyrics')}
|
||||
</p>
|
||||
{(() => {
|
||||
const lyricsText = songCompletionData
|
||||
? (songCompletionData.lyrics || '')
|
||||
: t('completion.sampleLyrics');
|
||||
if (!songCompletionData?.lyrics) {
|
||||
return <p className="comp2-lyrics-text">{lyricsText}</p>;
|
||||
}
|
||||
const lines = lyricsText.split('\n').filter((l: string) => l.trim());
|
||||
const size = Math.ceil(lines.length / 3);
|
||||
const sections = [
|
||||
{ tag: '[Verse]', lines: lines.slice(0, size) },
|
||||
{ tag: '[Chorus]', lines: lines.slice(size, size * 2) },
|
||||
{ tag: '[Outro]', lines: lines.slice(size * 2) },
|
||||
].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>
|
||||
|
||||
Reference in new issue
Block a user