Files
calendar/packages/ui/components/credits/Credits.tsx
T
0b03bcb90e feat: CalendarSettings atom (#16120)
* dumb components for calendar settings

* shadcn switch

* update exports

* update packages

* add calendar settings atom to examples app

* init calendar settings atom

* refactors

* fix import path

* export type for calendar switch props

* invalidate queries on deleting calendar credentials

* replace calendars list with calendar settings wrapper

* cleanup

* update styling

* refactors

* cleanup

* fix: missing key prop CalendarSettingsPlatformWrapper

* Label as client components

* Address client component build errors

* Move QueryCell out of packages/lib

* PR feedback

* more feedback

---------

Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
Co-authored-by: Morgan Vernay <morgan@cal.com>
Co-authored-by: Joe Au-Yeung <j.auyeung419@gmail.com>
2024-08-13 21:51:29 +05:30

46 lines
1.4 KiB
TypeScript

"use client";
import Link from "next/link";
import { useEffect, useState } from "react";
import { CALCOM_VERSION, COMPANY_NAME, IS_CALCOM, IS_SELF_HOSTED } from "@calcom/lib/constants";
// 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)}` : "";
const CalComVersion = `v.${CALCOM_VERSION}-${!IS_SELF_HOSTED ? "h" : "sh"}`;
export default function Credits() {
const [hasMounted, setHasMounted] = useState(false);
useEffect(() => {
setHasMounted(true);
}, []);
return (
<small className="text-default mx-3 mb-2 mt-1 hidden text-[0.5rem] opacity-50 lg:block">
&copy; {new Date().getFullYear()}{" "}
<Link href="https://go.cal.com/credits" target="_blank" className="hover:underline">
{COMPANY_NAME}
</Link>{" "}
{hasMounted && (
<>
<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
)}
</>
)}
</small>
);
}