import React from "react";
import ReactDOM from "react-dom";
import { Provider } from "react-redux";

import { store } from "./store";
import MusicPlayer from "./MusicPlayer";
import { setSource, setTitle } from "./store/music/types";
// @ts-ignore - mp3 files have no types.
import mseq from "./Mseq_-_Journey.mp3";

const rootElement = document.getElementById("playerUI");

ReactDOM.render(
    <Provider store={store}>
        <MusicPlayer />
    </Provider>,
    rootElement
);

store.dispatch(setSource(mseq));
store.dispatch(
    setTitle({
        name: "Journey",
        artist: "Mseq",
        album: "Unknown album",
        length: 192052244,
    })
);
