mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-02 02:43:33 +00:00
initial implementation for lyrics
This commit is contained in:
parent
8eb0029bb8
commit
23f9bd4e9f
9 changed files with 223 additions and 11 deletions
25
src/renderer/features/lyrics/unsynchronized-lyrics.tsx
Normal file
25
src/renderer/features/lyrics/unsynchronized-lyrics.tsx
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import { useMemo } from 'react';
|
||||
import { LyricLine } from '/@/renderer/features/lyrics/lyric-line';
|
||||
|
||||
interface UnsynchronizedLyricsProps {
|
||||
lyrics: string;
|
||||
}
|
||||
|
||||
export const UnsynchronizedLyrics = ({ lyrics }: UnsynchronizedLyricsProps) => {
|
||||
const lines = useMemo(() => {
|
||||
return lyrics.split('\n');
|
||||
}, [lyrics]);
|
||||
|
||||
return (
|
||||
<div>
|
||||
{lines.map((text, idx) => (
|
||||
<LyricLine
|
||||
key={idx}
|
||||
active={false}
|
||||
id={`lyric-${idx}`}
|
||||
lyric={text}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue