import { EmailIcon } from "@chakra-ui/icons";
import { Divider, Stack, useBreakpointValue } from "@chakra-ui/react";
import type { FunctionComponent } from "react";
import { PACKAGE_ANALYTICS } from "./constants";
import { usePackageState } from "./PackageState";
import testIds from "./testIds";
import { ExternalLink } from "../../components/ExternalLink";
import { CONSTRUCT_HUB_REPO_URL } from "../../constants/links";
import { GithubIcon } from "../../icons/GithubIcon";
const iconProps = {
h: 6,
ml: 2,
w: 6,
};
export const FeedbackLinks: FunctionComponent = () => {
const state = usePackageState();
const orientation = useBreakpointValue<"vertical" | "horizontal">({
base: "horizontal",
md: "vertical",
});
const divider = (
);
const metadata = state.metadata.data;
const assembly = state.assembly.data;
if (!(assembly && metadata)) return null;
const repo = assembly?.repository ?? {};
let repoUrl = undefined;
if (repo.type === "git") {
repoUrl = repo.url?.endsWith(".git")
? repo.url.replace(".git", "")
: repo.url;
if (repoUrl.endsWith("/")) {
repoUrl = repoUrl.slice(0, repoUrl.length - 1);
}
}
return (
{repoUrl && (
<>
}
variant="solid"
>
Provide feedback to publisher
{divider}
>
)}
}
>
Provide feedback to Construct Hub
{divider}
}
>
Report abuse
);
};