import { Box, Group } from '@mantine/core'; import isElectron from 'is-electron'; import { useTranslation } from 'react-i18next'; import { RiAddFill, RiSubtractFill } from 'react-icons/ri'; import { LyricsOverride } from '/@/renderer/api/types'; import { Button, NumberInput, Tooltip } from '/@/renderer/components'; import { openLyricSearchModal } from '/@/renderer/features/lyrics/components/lyrics-search-form'; import { useCurrentSong, useLyricsSettings, useSettingsStore, useSettingsStoreActions, } from '/@/renderer/store'; interface LyricsActionsProps { onRemoveLyric: () => void; onResetLyric: () => void; onSearchOverride: (params: LyricsOverride) => void; } export const LyricsActions = ({ onRemoveLyric, onResetLyric, onSearchOverride, }: LyricsActionsProps) => { const { t } = useTranslation(); const currentSong = useCurrentSong(); const { setSettings } = useSettingsStoreActions(); const { delayMs, sources } = useLyricsSettings(); const handleLyricOffset = (e: number) => { setSettings({ lyrics: { ...useSettingsStore.getState().lyrics, delayMs: e, }, }); }; const isActionsDisabled = !currentSong; const isDesktop = isElectron(); return ( {isDesktop && sources.length ? ( ) : null} {isDesktop && sources.length ? ( ) : null} {isDesktop && sources.length ? ( ) : null} ); };