chore: remove ssr

Signed-off-by: Adithya Krishna <adithya@documenso.com>
This commit is contained in:
Adithya Krishna
2024-03-05 15:34:42 +05:30
parent d29caaf823
commit a03ce728f3

View File

@ -1,7 +1,6 @@
'use client';
import type { HTMLAttributes } from 'react';
import { useEffect, useState } from 'react';
import Image from 'next/image';
import Link from 'next/link';
@ -13,17 +12,11 @@ import { Button } from '@documenso/ui/primitives/button';
export type TypefullyProps = HTMLAttributes<HTMLDivElement>;
export const Typefully = ({ className, ...props }: TypefullyProps) => {
const [isSSR, setIsSSR] = useState(true);
useEffect(() => {
setIsSSR(false);
}, []);
return (
<div className={cn('flex flex-col', className)} {...props}>
<h3 className="px-4 text-lg font-semibold">Twitter Stats</h3>
<div className="border-border mt-2.5 flex flex-1 items-center justify-center rounded-2xl border py-8 shadow-sm hover:shadow">
{!isSSR && (
<div className="flex flex-col gap-y-4 text-center">
<Image className="opacity-75" src={Twitter} alt="Twitter Logo" width={120} />
<Link href="https://typefully.com/documenso/stats" target="_blank">
@ -40,7 +33,6 @@ export const Typefully = ({ className, ...props }: TypefullyProps) => {
</Link>
</Button>
</div>
)}
</div>
</div>
);