2023-06-08 03:40:58 -07:00
|
|
|
import { RiAddFill, RiSubtractFill } from 'react-icons/ri';
|
2023-06-09 02:38:04 -07:00
|
|
|
import { LyricsOverride } from '/@/renderer/api/types';
|
2023-06-08 03:40:58 -07:00
|
|
|
import { Button, NumberInput } from '/@/renderer/components';
|
|
|
|
|
import { openLyricSearchModal } from '/@/renderer/features/lyrics/components/lyrics-search-form';
|
|
|
|
|
import { useCurrentSong } from '/@/renderer/store';
|
|
|
|
|
|
2023-06-09 02:38:04 -07:00
|
|
|
interface LyricsActionsProps {
|
|
|
|
|
onSearchOverride?: (params: LyricsOverride) => void;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const LyricsActions = ({ onSearchOverride }: LyricsActionsProps) => {
|
2023-06-08 03:40:58 -07:00
|
|
|
const currentSong = useCurrentSong();
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Button
|
2023-06-09 02:38:04 -07:00
|
|
|
uppercase
|
|
|
|
|
variant="subtle"
|
2023-06-08 03:40:58 -07:00
|
|
|
onClick={() =>
|
|
|
|
|
openLyricSearchModal({
|
|
|
|
|
artist: currentSong?.artistName,
|
|
|
|
|
name: currentSong?.name,
|
2023-06-09 02:38:04 -07:00
|
|
|
onSearchOverride,
|
2023-06-08 03:40:58 -07:00
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
Search
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
tooltip={{ label: 'Decrease offset', openDelay: 500 }}
|
2023-06-09 02:38:04 -07:00
|
|
|
variant="subtle"
|
2023-06-08 03:40:58 -07:00
|
|
|
>
|
|
|
|
|
<RiSubtractFill />
|
|
|
|
|
</Button>
|
|
|
|
|
<NumberInput
|
|
|
|
|
styles={{ input: { textAlign: 'center' } }}
|
|
|
|
|
width={55}
|
|
|
|
|
/>
|
|
|
|
|
<Button
|
|
|
|
|
tooltip={{ label: 'Increase offset', openDelay: 500 }}
|
2023-06-09 02:38:04 -07:00
|
|
|
variant="subtle"
|
2023-06-08 03:40:58 -07:00
|
|
|
>
|
|
|
|
|
<RiAddFill />
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
2023-06-09 02:38:04 -07:00
|
|
|
uppercase
|
|
|
|
|
variant="subtle"
|
2023-06-08 03:40:58 -07:00
|
|
|
onClick={() =>
|
|
|
|
|
openLyricSearchModal({
|
|
|
|
|
artist: currentSong?.artistName,
|
|
|
|
|
name: currentSong?.name,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
Clear
|
|
|
|
|
</Button>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
};
|