import isElectron from 'is-electron'; import { useTranslation } from 'react-i18next'; import { openLyricSearchModal } from '/@/renderer/features/lyrics/components/lyrics-search-form'; import { useCurrentSong, useLyricsSettings, useSettingsStore, useSettingsStoreActions, } 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 }[]; onRemoveLyric: () => void; onResetLyric: () => void; onSearchOverride: (params: LyricsOverride) => void; onTranslateLyric: () => void; setIndex: (idx: number) => void; } export const LyricsActions = ({ index, languages, onRemoveLyric, onResetLyric, onSearchOverride, onTranslateLyric, setIndex, }: LyricsActionsProps) => { const { t } = useTranslation(); const currentSong = useCurrentSong(); const { setSettings } = useSettingsStoreActions(); const { delayMs, sources } = useLyricsSettings(); const handleLyricOffset = (e: number | string) => { setSettings({ lyrics: { ...useSettingsStore.getState().lyrics, delayMs: Number(e), }, }); }; const isActionsDisabled = !currentSong; const isDesktop = isElectron(); return (