import isElectron from 'is-electron'; import { useTranslation } from 'react-i18next'; import { openLyricSearchModal } from '/@/renderer/features/lyrics/components/lyrics-search-form'; import { useLyricsSettings, usePlayerSong } from '/@/renderer/store'; import { ActionIcon } from '/@/shared/components/action-icon/action-icon'; import { Button } from '/@/shared/components/button/button'; import { Center } from '/@/shared/components/center/center'; import { Group } from '/@/shared/components/group/group'; import { NumberInput } from '/@/shared/components/number-input/number-input'; import { Select } from '/@/shared/components/select/select'; import { Tooltip } from '/@/shared/components/tooltip/tooltip'; import { LyricsOverride } from '/@/shared/types/domain-types'; interface LyricsActionsProps { index: number; languages: { label: string; value: string }[]; offsetMs: number; onRemoveLyric: () => void; onSearchOverride: (params: LyricsOverride) => void; onTranslateLyric?: () => void; onUpdateOffset: (offsetMs: number) => void; setIndex: (idx: number) => void; synced?: boolean; } export const LyricsActions = ({ index, languages, offsetMs, onRemoveLyric, onSearchOverride, onTranslateLyric, onUpdateOffset, setIndex, }: LyricsActionsProps) => { const { t } = useTranslation(); const currentSong = usePlayerSong(); const { sources } = useLyricsSettings(); const handleLyricOffset = (e: number | string) => { onUpdateOffset(Number(e)); }; const isActionsDisabled = !currentSong; const isDesktop = isElectron(); return (
{languages.length > 1 && (