import React, { useState } from "react";
import DownloadLink from "./DownloadLink";
import * as Utils from "../utils";
import LinkInput from "./LinkInput";
import { API_URL } from "../constants";
// import * as Actions from "../redux/actionCreators";
import * as Selectors from "../redux/selectors";
import * as Actions from "../redux/actionCreators";
import { useSelector } from "react-redux";
// import { useActionCreator } from "../hooks";
import DownloadText from "./DownloadText";
import { useActionCreator } from "../hooks";
function Metadata() {
const hash = useSelector(Selectors.getSelectedSkinHash);
const skinData = useSelector((state) => state.skins[hash] || null);
console.log(skinData);
const fileName = skinData && skinData.fileName;
const permalink = useSelector(
Selectors.getAbsolutePermalinkUrlFromHashGetter
)(hash);
// const toggleFileExplorer = useActionCreator(Actions.toggleFileExplorer);
const focusedSkinFile = useSelector(Selectors.getFocusedSkinFile);
const markNsfw = useActionCreator(Actions.markNsfw);
const [showLink, setShowLink] = useState(false);
// TODO: Move to Epic
async function report(e) {
e.preventDefault();
markNsfw(hash);
}
let readmeLink = null;
if (
focusedSkinFile != null &&
focusedSkinFile.content != null &&
focusedSkinFile.fileName != null
) {
readmeLink = (