2023-01-02 19:44:51 +00:00
|
|
|
import Link from "next/link";
|
|
|
|
import { useEffect, useState } from "react";
|
|
|
|
|
2023-07-10 14:10:30 +00:00
|
|
|
import { COMPANY_NAME, IS_SELF_HOSTED, IS_CALCOM } from "@calcom/lib/constants";
|
2023-06-22 22:25:37 +00:00
|
|
|
|
|
|
|
// Relative to prevent triggering a recompile
|
|
|
|
import pkg from "../../../../apps/web/package.json";
|
2023-01-02 19:44:51 +00:00
|
|
|
|
2023-07-10 14:10:30 +00:00
|
|
|
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
|
|
|
const vercelCommitHash = process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA;
|
|
|
|
const commitHash = vercelCommitHash ? `-${vercelCommitHash.slice(0, 7)}` : "";
|
|
|
|
|
2023-05-23 10:42:01 +00:00
|
|
|
export const CalComVersion = `v.${pkg.version}-${!IS_SELF_HOSTED ? "h" : "sh"}`;
|
2023-01-02 19:44:51 +00:00
|
|
|
|
|
|
|
export default function Credits() {
|
|
|
|
const [hasMounted, setHasMounted] = useState(false);
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
setHasMounted(true);
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
return (
|
2023-06-22 22:25:37 +00:00
|
|
|
<small className="text-default mx-3 mb-2 mt-1 hidden text-[0.5rem] opacity-50 lg:block">
|
2023-01-02 19:44:51 +00:00
|
|
|
© {new Date().getFullYear()}{" "}
|
2023-01-06 12:13:56 +00:00
|
|
|
<Link href="https://go.cal.com/credits" target="_blank" className="hover:underline">
|
|
|
|
{COMPANY_NAME}
|
2023-01-02 19:44:51 +00:00
|
|
|
</Link>{" "}
|
|
|
|
{hasMounted && (
|
2023-07-10 14:10:30 +00:00
|
|
|
<>
|
|
|
|
<Link href="https://go.cal.com/releases" target="_blank" className="hover:underline">
|
|
|
|
{CalComVersion}
|
|
|
|
</Link>
|
|
|
|
{vercelCommitHash && IS_CALCOM ? (
|
|
|
|
<Link
|
|
|
|
href={`https://github.com/calcom/cal.com/commit/${vercelCommitHash}`}
|
|
|
|
target="_blank"
|
|
|
|
className="hover:underline">
|
|
|
|
{commitHash}
|
|
|
|
</Link>
|
|
|
|
) : (
|
|
|
|
commitHash
|
|
|
|
)}
|
|
|
|
</>
|
2023-01-02 19:44:51 +00:00
|
|
|
)}
|
|
|
|
</small>
|
|
|
|
);
|
|
|
|
}
|