Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

chore: format w/ prettier

Marc Seitz96bf37fed318
diff --git a/app/(static)/layout.tsx b/app/(static)/layout.tsx
index ce74aacb..9596598e 100644
--- a/app/(static)/layout.tsx
+++ b/app/(static)/layout.tsx
@@ -2,7 +2,6 @@ import Footer from "@/components/web/footer";
import Navbar from "@/components/web/navbar";
import { Metadata } from "next";
-
const data = {
description:
"Papermark is an open-source document infrastructure for sharing and collaboration. Free alternative to Docsend with custom domain. Manage secure document sharing with real-time analytics.",
@@ -37,7 +36,7 @@ export const metadata: Metadata = {
},
};
-export default function Layout({children}: {children: React.ReactNode}) {
+export default function Layout({ children }: { children: React.ReactNode }) {
return (
<>
<Navbar />
diff --git a/app/(static)/open-source-investors/ClientPage.tsx b/app/(static)/open-source-investors/ClientPage.tsx
index 5c5697d6..0b2777dc 100644
--- a/app/(static)/open-source-investors/ClientPage.tsx
+++ b/app/(static)/open-source-investors/ClientPage.tsx
@@ -14,12 +14,24 @@ const searchOptions = {
location: 0,
distance: 100,
minMatchCharLength: 2,
- keys: ["fields.name", "fields.twitterUrl", "fields.company", "fields.title", "fields.openSourceInvestments"],
+ keys: [
+ "fields.name",
+ "fields.twitterUrl",
+ "fields.company",
+ "fields.title",
+ "fields.openSourceInvestments",
+ ],
};
function compare(a: any, b: any) {
// Define the order of the checkSize labels
- const checkSizesOrder = ["$5k - $50k", "$50k+", "$100k+", "$250k+", "Unknown"];
+ const checkSizesOrder = [
+ "$5k - $50k",
+ "$50k+",
+ "$100k+",
+ "$250k+",
+ "Unknown",
+ ];
const orderA = checkSizesOrder.indexOf(a.fields.checkSize);
const orderB = checkSizesOrder.indexOf(b.fields.checkSize);
@@ -32,8 +44,6 @@ function compare(a: any, b: any) {
return orderA - orderB;
}
-
-
export default function Dashboard({ data }: any) {
const { records: allInvestors } = data;
const [search, setSearch] = useState("");
@@ -50,13 +60,12 @@ export default function Dashboard({ data }: any) {
];
const selectedCheckSize = checkSizes.find(
- (checkSize) => checkSize.id === category
+ (checkSize) => checkSize.id === category,
);
const labelForSelectedCategory = selectedCheckSize
? selectedCheckSize.label
: null;
-
// Define filtered & sorted investor array
const ALL_INVESTORS = allInvestors
// .filter((angel: any) => !angel.hidden)
@@ -102,7 +111,7 @@ export default function Dashboard({ data }: any) {
(!category && checkSize.id === "7")
? "bg-gray-200"
: "bg-white hover:bg-gray-50",
- "relative inline-flex items-center first-of-type:rounded-l-md last-of-type:rounded-r-md border border-gray-300 px-4 py-2 text-sm font-medium text-gray-700 focus:z-10 focus:outline-none focus:ring-gray-500 -ml-px first-of-type:-ml-0"
+ "relative inline-flex items-center first-of-type:rounded-l-md last-of-type:rounded-r-md border border-gray-300 px-4 py-2 text-sm font-medium text-gray-700 focus:z-10 focus:outline-none focus:ring-gray-500 -ml-px first-of-type:-ml-0",
)}
>
{checkSize.label}
diff --git a/app/(static)/open-source-investors/page.tsx b/app/(static)/open-source-investors/page.tsx
index 77b09d85..b6b15884 100644
--- a/app/(static)/open-source-investors/page.tsx
+++ b/app/(static)/open-source-investors/page.tsx
@@ -45,7 +45,7 @@ const getInvestors = async () => {
headers: {
Authorization: `Bearer ${process.env.AIRTABLE_API_KEY}`,
},
- }
+ },
);
if (!response.ok) {
throw new Error("Network response was not ok " + response.statusText);
diff --git a/components/PDFViewer.tsx b/components/PDFViewer.tsx
index 23ee503b..550a8534 100644
--- a/components/PDFViewer.tsx
+++ b/components/PDFViewer.tsx
@@ -144,20 +144,24 @@ export default function PDFViewer(props: any) {
<div
hidden={loading}
style={{ height: "calc(100vh - 64px)" }}
- className="flex items-center">
+ className="flex items-center"
+ >
<div
- className={`flex items-center justify-between w-full absolute z-10 px-2`}>
+ className={`flex items-center justify-between w-full absolute z-10 px-2`}
+ >
<button
onClick={goToPreviousPage}
disabled={pageNumber <= 1}
- className="relative h-[calc(100vh - 64px)] px-2 py-24 text-gray-400 hover:text-gray-50 focus:z-20">
+ className="relative h-[calc(100vh - 64px)] px-2 py-24 text-gray-400 hover:text-gray-50 focus:z-20"
+ >
<span className="sr-only">Previous</span>
<ChevronLeftIcon className="h-10 w-10" aria-hidden="true" />
</button>
<button
onClick={goToNextPage}
disabled={pageNumber >= numPages!}
- className="relative h-[calc(100vh - 64px)] px-2 py-24 text-gray-400 hover:text-gray-50 focus:z-20">
+ className="relative h-[calc(100vh - 64px)] px-2 py-24 text-gray-400 hover:text-gray-50 focus:z-20"
+ >
<span className="sr-only">Next</span>
<ChevronRightIcon className="h-10 w-10" aria-hidden="true" />
</button>
@@ -169,7 +173,8 @@ export default function PDFViewer(props: any) {
onLoadSuccess={onDocumentLoadSuccess}
options={options}
renderMode="canvas"
- className="">
+ className=""
+ >
<Page
className=""
key={pageNumber}
diff --git a/components/PagesViewer.tsx b/components/PagesViewer.tsx
index 80db7a16..da888a58 100644
--- a/components/PagesViewer.tsx
+++ b/components/PagesViewer.tsx
@@ -2,7 +2,19 @@ import { ChevronLeftIcon, ChevronRightIcon } from "@heroicons/react/20/solid";
import { useEffect, useRef, useState } from "react";
import { BlurImage } from "@/components/shared/blur-image";
-export default function PagesViewer({pages, linkId, documentId, viewId, versionNumber}: {pages: { file: string, pageNumber: string }[], linkId: string, documentId: string, viewId: string, versionNumber: number}) {
+export default function PagesViewer({
+ pages,
+ linkId,
+ documentId,
+ viewId,
+ versionNumber,
+}: {
+ pages: { file: string; pageNumber: string }[];
+ linkId: string;
+ documentId: string;
+ viewId: string;
+ versionNumber: number;
+}) {
const [pageNumber, setPageNumber] = useState<number>(1); // start on first page
const startTimeRef = useRef(Date.now());
@@ -135,8 +147,13 @@ export default function PagesViewer({pages, linkId, documentId, viewId, versionN
);
}
-
-function Nav({pageNumber, numPages}: {pageNumber: number, numPages: number}) {
+function Nav({
+ pageNumber,
+ numPages,
+}: {
+ pageNumber: number;
+ numPages: number;
+}) {
return (
<nav className="bg-black">
<div className="mx-auto px-2 sm:px-6 lg:px-8">
@@ -158,4 +175,4 @@ function Nav({pageNumber, numPages}: {pageNumber: number, numPages: number}) {
</div>
</nav>
);
-}
\ No newline at end of file
+}
diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx
index 34e87eb0..fd7caa64 100644
--- a/components/Sidebar.tsx
+++ b/components/Sidebar.tsx
@@ -81,7 +81,8 @@ export default function Sidebar() {
<Dialog
as="div"
className="relative z-50 xl:hidden"
- onClose={setSidebarOpen}>
+ onClose={setSidebarOpen}
+ >
<Transition.Child
as={Fragment}
enter="transition-opacity ease-linear duration-300"
@@ -89,7 +90,8 @@ export default function Sidebar() {
enterTo="opacity-100"
leave="transition-opacity ease-linear duration-300"
leaveFrom="opacity-100"
- leaveTo="opacity-0">
+ leaveTo="opacity-0"
+ >
<div className="fixed inset-0 bg-background/80" />
</Transition.Child>
@@ -101,7 +103,8 @@ export default function Sidebar() {
enterTo="translate-x-0"
leave="transition ease-in-out duration-300 transform"
leaveFrom="translate-x-0"
- leaveTo="-translate-x-full">
+ leaveTo="-translate-x-full"
+ >
<Dialog.Panel className="relative mr-16 flex w-full max-w-xs flex-1">
<Transition.Child
as={Fragment}
@@ -110,12 +113,14 @@ export default function Sidebar() {
enterTo="opacity-100"
leave="ease-in-out duration-300"
leaveFrom="opacity-100"
- leaveTo="opacity-0">
+ leaveTo="opacity-0"
+ >
<div className="absolute left-full top-0 flex w-16 justify-center pt-5">
<button
type="button"
className="-m-2.5 p-2.5"
- onClick={() => setSidebarOpen(false)}>
+ onClick={() => setSidebarOpen(false)}
+ >
<span className="sr-only">Close sidebar</span>
<X
className="h-6 w-6 text-foreground"
@@ -154,9 +159,10 @@ export default function Sidebar() {
item.current
? "bg-gray-200 dark:bg-secondary text-secondary-foreground font-semibold"
: "text-muted-foreground hover:text-foreground hover:bg-gray-200 hover:dark:bg-muted",
- "group flex gap-x-3 items-center rounded-md p-2 text-sm leading-6 w-full disabled:hover:bg-transparent disabled:text-muted-foreground disabled:cursor-default"
+ "group flex gap-x-3 items-center rounded-md p-2 text-sm leading-6 w-full disabled:hover:bg-transparent disabled:text-muted-foreground disabled:cursor-default",
)}
- disabled={item.disabled}>
+ disabled={item.disabled}
+ >
<item.icon
className="h-5 w-5 shrink-0"
aria-hidden="true"
@@ -208,9 +214,10 @@ export default function Sidebar() {
item.current
? "bg-gray-200 dark:bg-secondary text-secondary-foreground font-semibold"
: "text-muted-foreground hover:text-foreground hover:bg-gray-200 hover:dark:bg-muted",
- "group flex gap-x-3 items-center rounded-md p-2 text-sm leading-6 w-full disabled:hover:bg-transparent disabled:text-muted-foreground disabled:cursor-default"
+ "group flex gap-x-3 items-center rounded-md p-2 text-sm leading-6 w-full disabled:hover:bg-transparent disabled:text-muted-foreground disabled:cursor-default",
)}
- disabled={item.disabled}>
+ disabled={item.disabled}
+ >
<item.icon
className="h-5 w-5 shrink-0"
aria-hidden="true"
@@ -259,7 +266,8 @@ export default function Sidebar() {
enterTo="transform opacity-100 scale-100"
leave="transition ease-in duration-75"
leaveFrom="transform opacity-100 scale-100"
- leaveTo="transform opacity-0 scale-95">
+ leaveTo="transform opacity-0 scale-95"
+ >
<Menu.Items className="absolute left-0 z-10 bottom-0 mb-14 w-full origin-bottom-left rounded-md bg-gray-100 dark:bg-primary-foreground py-2 focus:outline-none">
{session ? (
<>
@@ -275,7 +283,8 @@ export default function Sidebar() {
Help?{" "}
<a
href="mailto:[email protected]"
- className="underline hover:text-muted-foreground/80">
+ className="underline hover:text-muted-foreground/80"
+ >
</a>
</p>
@@ -288,7 +297,8 @@ export default function Sidebar() {
})
}
className="block px-3 py-1 text-sm leading-6 text-foreground hover:bg-gray-200 hover:dark:bg-muted"
- href={""}>
+ href={""}
+ >
Sign Out
</Link>
</Menu.Item>
@@ -311,7 +321,8 @@ export default function Sidebar() {
<button
type="button"
className="-m-2.5 p-2.5 text-muted-foreground lg:hidden"
- onClick={() => setSidebarOpen(true)}>
+ onClick={() => setSidebarOpen(true)}
+ >
<span className="sr-only">Open sidebar</span>
<MenuIcon className="h-6 w-6" aria-hidden="true" />
</button>
@@ -337,7 +348,8 @@ export default function Sidebar() {
enterTo="transform opacity-100 scale-100"
leave="transition ease-in duration-75"
leaveFrom="transform opacity-100 scale-100"
- leaveTo="transform opacity-0 scale-95">
+ leaveTo="transform opacity-0 scale-95"
+ >
<Menu.Items className="absolute right-0 z-10 mt-2.5 w-fit origin-top-right rounded-md bg-primary-foreground shadow-lg py-2 ring-1 ring-primary-foreground/5 focus:outline-none">
{session ? (
<>
@@ -354,7 +366,8 @@ export default function Sidebar() {
})
}
className="block px-3 py-1 text-sm leading-6 text-foreground hover:bg-gray-200 hover:dark:bg-muted"
- href={""}>
+ href={""}
+ >
Sign Out
</Link>
</Menu.Item>
diff --git a/components/banner.tsx b/components/banner.tsx
index bb6c7d64..79cfa6c8 100644
--- a/components/banner.tsx
+++ b/components/banner.tsx
@@ -9,14 +9,16 @@ const cutoffDate = new Date("2023-10-12T00:00:00.000Z");
export default function Banner({ session }: { session: Session | null }) {
const { domains } = useDomains();
-
+
const userDaysLeft = calculateDaysLeft(
- new Date((session?.user as CustomUser).createdAt || 0)
+ new Date((session?.user as CustomUser).createdAt || 0),
);
const noDomains = domains && domains.length === 0;
- const someNotVerified = domains && !noDomains && domains.some((domain) => !domain.verified);
- const allVerified = domains && !noDomains && domains.every((domain) => domain.verified);
+ const someNotVerified =
+ domains && !noDomains && domains.some((domain) => !domain.verified);
+ const allVerified =
+ domains && !noDomains && domains.every((domain) => domain.verified);
return (
<aside className="flex flex-col justify-center w-full bg-background text-foreground p-4 mb-2 rounded-lg border border-gray-700">
@@ -27,9 +29,7 @@ export default function Banner({ session }: { session: Session | null }) {
{`You are on the Pro trial for the next ${userDaysLeft} days.`}
</p>
{allVerified ? (
- <p className="text-sm text-green-500">
- {`Your domain is verified.`}
- </p>
+ <p className="text-sm text-green-500">{`Your domain is verified.`}</p>
) : (
<Button variant={someNotVerified ? `destructive` : `default`}>
<Link href="/settings/domains" target="_blank">
@@ -41,4 +41,4 @@ export default function Banner({ session }: { session: Session | null }) {
)}
</aside>
);
-}
\ No newline at end of file
+}
diff --git a/components/billing/upgrade-plan-modal.tsx b/components/billing/upgrade-plan-modal.tsx
index 2ad034b0..7e20cf2c 100644
--- a/components/billing/upgrade-plan-modal.tsx
+++ b/components/billing/upgrade-plan-modal.tsx
@@ -39,7 +39,8 @@ export function UpgradePlanModal({ children }: { children: React.ReactNode }) {
}}
initial="hidden"
animate="show"
- className="flex flex-col items-center justify-center space-y-3 border-b border-border px-4 py-8 sm:px-16">
+ className="flex flex-col items-center justify-center space-y-3 border-b border-border px-4 py-8 sm:px-16"
+ >
<motion.div variants={STAGGER_CHILD_VARIANTS}>
<p className="text-2xl font-bold tracking-tighter text-foreground">
Papermark
@@ -47,12 +48,14 @@ export function UpgradePlanModal({ children }: { children: React.ReactNode }) {
</motion.div>
<motion.h3
className="text-lg font-medium"
- variants={STAGGER_CHILD_VARIANTS}>
+ variants={STAGGER_CHILD_VARIANTS}
+ >
Upgrade to {plan}
</motion.h3>
<motion.p
className="text-center text-sm text-muted-foreground"
- variants={STAGGER_CHILD_VARIANTS}>
+ variants={STAGGER_CHILD_VARIANTS}
+ >
Enjoy higher limits and extra features with our {plan} plan.
</motion.p>
</motion.div>
@@ -61,7 +64,8 @@ export function UpgradePlanModal({ children }: { children: React.ReactNode }) {
className="flex flex-col space-y-3"
variants={STAGGER_CHILD_VARIANTS}
initial="hidden"
- animate="show">
+ animate="show"
+ >
<div className="mb-4">
<div className="mb-4 flex items-center justify-between">
<div className="flex items-center space-x-2">
@@ -70,7 +74,8 @@ export function UpgradePlanModal({ children }: { children: React.ReactNode }) {
</h4>
<Badge
variant="outline"
- className="text-sm font-normal normal-case">{`$${
+ className="text-sm font-normal normal-case"
+ >{`$${
PLANS.find((p) => p.name === plan)!.price[period].amount
}/${period.replace("ly", "")}`}</Badge>
</div>
@@ -78,7 +83,8 @@ export function UpgradePlanModal({ children }: { children: React.ReactNode }) {
onClick={() => {
setPeriod(period === "monthly" ? "yearly" : "monthly");
}}
- className="text-xs text-muted-foreground underline underline-offset-4 transition-colors hover:text-gray-800 hover:dark:text-muted-foreground/80">
+ className="text-xs text-muted-foreground underline underline-offset-4 transition-colors hover:text-gray-800 hover:dark:text-muted-foreground/80"
+ >
{period === "monthly"
? "Get 2 months free 🎁"
: "Switch to monthly"}
@@ -94,12 +100,14 @@ export function UpgradePlanModal({ children }: { children: React.ReactNode }) {
}}
initial="hidden"
animate="show"
- className="flex flex-col space-y-2">
+ className="flex flex-col space-y-2"
+ >
{features.map((feature, i) => (
<motion.div
key={i}
variants={STAGGER_CHILD_VARIANTS}
- className="flex items-center space-x-2 text-sm text-muted-foreground">
+ className="flex items-center space-x-2 text-sm text-muted-foreground"
+ >
<CheckCircle2 className="h-5 w-5 text-emerald-500" />
<span>{feature}</span>
</motion.div>
@@ -111,9 +119,8 @@ export function UpgradePlanModal({ children }: { children: React.ReactNode }) {
onClick={() => {
setClicked(true);
fetch(
- `/api/teams/${
- teamInfo?.currentTeam?.id
- }/billing/upgrade?priceId=${
+ `/api/teams/${teamInfo?.currentTeam
+ ?.id}/billing/upgrade?priceId=${
PLANS.find((p) => p.name === plan)!.price[period].priceIds[
process.env.NEXT_PUBLIC_VERCEL_ENV === "production"
? "production"
@@ -122,7 +129,7 @@ export function UpgradePlanModal({ children }: { children: React.ReactNode }) {
}`,
{
method: "POST",
- }
+ },
)
.then(async (res) => {
const data = await res.json();
@@ -134,7 +141,8 @@ export function UpgradePlanModal({ children }: { children: React.ReactNode }) {
alert(err);
setClicked(false);
});
- }}>{`Upgrade to ${plan} ${capitalize(period)}`}</Button>
+ }}
+ >{`Upgrade to ${plan} ${capitalize(period)}`}</Button>
</motion.div>
</div>
</DialogContent>
diff --git a/components/charts/bar-chart.tsx b/components/charts/bar-chart.tsx
index 4175881c..3967340e 100644
--- a/components/charts/bar-chart.tsx
+++ b/components/charts/bar-chart.tsx
@@ -2,16 +2,16 @@ import { BarChart } from "@tremor/react";
import { useState } from "react";
type Data = {
- pageNumber: string;
- data: {
- versionNumber: number;
- avg_duration: number;
- }[]
+ pageNumber: string;
+ data: {
+ versionNumber: number;
+ avg_duration: number;
+ }[];
};
type SumData = {
- pageNumber: string;
- sum_duration: number;
+ pageNumber: string;
+ sum_duration: number;
};
type TransformedData = {
@@ -74,7 +74,6 @@ const renameSumDurationKey = (data: SumData[]) => {
});
};
-
// Transform data
const transformData = (data: Data[]): TransformedData[] => {
return data.reduce((acc, { pageNumber, data }) => {
@@ -82,7 +81,7 @@ const transformData = (data: Data[]): TransformedData[] => {
data.forEach(({ versionNumber, avg_duration }) => {
transformedItem[`Version ${versionNumber}`] = avg_duration;
- })
+ });
acc.push(transformedItem as TransformedData);
return acc;
@@ -93,13 +92,12 @@ const getVersionNumbers = (data: TransformedData[]) => {
return [
...new Set(
data.flatMap((item) =>
- Object.keys(item).filter((key) => key !== "pageNumber")
- )
+ Object.keys(item).filter((key) => key !== "pageNumber"),
+ ),
),
];
};
-
const getColors = (versionNumbers: string[]): Color[] => {
const colorArray = [
"emerald",
@@ -130,7 +128,13 @@ const getColors = (versionNumbers: string[]): Color[] => {
});
};
-export default function BarChartComponent({data, isSum = false}: {data: any, isSum?: boolean}) {
+export default function BarChartComponent({
+ data,
+ isSum = false,
+}: {
+ data: any;
+ isSum?: boolean;
+}) {
const [, setValue] = useState<any>(null);
if (isSum) {
@@ -151,7 +155,6 @@ export default function BarChartComponent({data, isSum = false}: {data: any, isS
);
}
-
const renamedData = transformData(data);
const versionNumbers = getVersionNumbers(renamedData);
const colors = getColors(versionNumbers);
@@ -159,7 +162,7 @@ export default function BarChartComponent({data, isSum = false}: {data: any, isS
console.log("renamedData", renamedData);
console.log("versionNumbers", versionNumbers);
console.log("colors", colors);
-
+
return (
<BarChart
className="mt-6 rounded-tremor-small"
diff --git a/components/document-upload.tsx b/components/document-upload.tsx
index 17f505fe..33683eb5 100644
--- a/components/document-upload.tsx
+++ b/components/document-upload.tsx
@@ -1,9 +1,16 @@
import { useMemo } from "react";
import { useDropzone } from "react-dropzone";
-import { ArrowUpTrayIcon, DocumentIcon, PhotoIcon } from "@heroicons/react/24/outline";
-import { DocumentTextIcon, PresentationChartBarIcon } from "@heroicons/react/20/solid";
+import {
+ ArrowUpTrayIcon,
+ DocumentIcon,
+ PhotoIcon,
+} from "@heroicons/react/24/outline";
+import {
+ DocumentTextIcon,
+ PresentationChartBarIcon,
+} from "@heroicons/react/20/solid";
import { bytesToSize } from "@/lib/utils";
-import { toast } from "sonner"
+import { toast } from "sonner";
function fileIcon(fileType: string) {
switch (fileType) {
@@ -44,11 +51,11 @@ export default function DocumentUpload({
const { errors } = fileRejections[0];
let message;
if (errors[0].code === "file-too-large") {
- message = "File size too big (max. 30 MB)"
+ message = "File size too big (max. 30 MB)";
} else if (errors[0].code === "file-invalid-type") {
- message = "File type not supported (.pdf only)"
+ message = "File type not supported (.pdf only)";
} else {
- message = errors[0].message
+ message = errors[0].message;
}
toast.error(message);
},
@@ -56,7 +63,7 @@ export default function DocumentUpload({
const imageBlobUrl = useMemo(
() => (currentFile ? URL.createObjectURL(currentFile) : ""),
- [currentFile]
+ [currentFile],
);
return (
@@ -97,13 +104,11 @@ export default function DocumentUpload({
</span>
</div>
<p className="text-xs leading-5 text-gray-500">
- {currentFile
- ? "Replace file?"
- : "Only *.pdf & 30 MB limit"}
+ {currentFile ? "Replace file?" : "Only *.pdf & 30 MB limit"}
</p>
</div>
</div>
</div>
</div>
);
-}
\ No newline at end of file
+}
diff --git a/components/documents/add-document-modal.tsx b/components/documents/add-document-modal.tsx
index 0af6f7db..97bf6cd9 100644
--- a/components/documents/add-document-modal.tsx
+++ b/components/documents/add-document-modal.tsx
@@ -20,7 +20,13 @@ import { useTeam } from "@/context/team-context";
pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js`;
-export function AddDocumentModal({newVersion, children}: {newVersion?: boolean, children: React.ReactNode}) {
+export function AddDocumentModal({
+ newVersion,
+ children,
+}: {
+ newVersion?: boolean;
+ children: React.ReactNode;
+}) {
const router = useRouter();
const plausible = usePlausible();
const [uploading, setUploading] = useState<boolean>(false);
@@ -58,7 +64,7 @@ export function AddDocumentModal({newVersion, children}: {newVersion?: boolean,
response = await saveNewVersionToDatabase(
newBlob,
documentId as string,
- numPages
+ numPages,
);
}
}
@@ -66,13 +72,13 @@ export function AddDocumentModal({newVersion, children}: {newVersion?: boolean,
if (response) {
const document = await response.json();
- console.log("document: ", document)
+ console.log("document: ", document);
if (!newVersion) {
// copy the link to the clipboard
copyToClipboard(
`${process.env.NEXT_PUBLIC_BASE_URL}/view/${document.links[0].id}`,
- "Document uploaded and link copied to clipboard. Redirecting to document page..."
+ "Document uploaded and link copied to clipboard. Redirecting to document page...",
);
// track the event
@@ -94,8 +100,6 @@ export function AddDocumentModal({newVersion, children}: {newVersion?: boolean,
setUploading(false);
}, 2000);
}
-
-
}
} catch (error) {
console.error("An error occurred while uploading the file: ", error);
@@ -104,7 +108,7 @@ export function AddDocumentModal({newVersion, children}: {newVersion?: boolean,
async function saveDocumentToDatabase(
blob: PutBlobResult,
- numPages?: number
+ numPages?: number,
) {
// create a document in the database with the blob url
const response = await fetch(
@@ -119,7 +123,7 @@ export function AddDocumentModal({newVersion, children}: {newVersion?: boolean,
url: blob.url,
numPages: numPages,
}),
- }
+ },
);
if (!response.ok) {
@@ -130,7 +134,11 @@ export function AddDocumentModal({newVersion, children}: {newVersion?: boolean,
}
// create a new version in the database
- async function saveNewVersionToDatabase(blob: PutBlobResult, documentId: string, numPages?: number) {
+ async function saveNewVersionToDatabase(
+ blob: PutBlobResult,
+ documentId: string,
+ numPages?: number,
+ ) {
const response = await fetch(
`/api/teams/${teamInfo?.currentTeam?.id}/documents/${documentId}/versions`,
{
@@ -143,7 +151,7 @@ export function AddDocumentModal({newVersion, children}: {newVersion?: boolean,
numPages: numPages,
type: "pdf",
}),
- }
+ },
);
if (!response.ok) {
@@ -164,18 +172,23 @@ export function AddDocumentModal({newVersion, children}: {newVersion?: boolean,
<DialogTrigger asChild>{children}</DialogTrigger>
<DialogContent className="text-foreground bg-background">
<DialogHeader>
- <DialogTitle>{newVersion ? `Upload a new version` : `Share a document`}</DialogTitle>
+ <DialogTitle>
+ {newVersion ? `Upload a new version` : `Share a document`}
+ </DialogTitle>
<DialogDescription>
<div className="border-b border-border py-2">
<p className="mb-1 text-sm text-muted-foreground">
- {newVersion ? `After you upload a new version, the existing links will remain the unchanged but ` : `After you upload the document, a shareable link will be
+ {newVersion
+ ? `After you upload a new version, the existing links will remain the unchanged but `
+ : `After you upload the document, a shareable link will be
generated and copied to your clipboard.`}
</p>
</div>
<form
encType="multipart/form-data"
onSubmit={handleBrowserUpload}
- className="flex flex-col">
+ className="flex flex-col"
+ >
<div className="space-y-12">
<div className="pb-6">
<div className="mt-10 grid grid-cols-1 gap-x-6 gap-y-8 sm:grid-cols-6">
@@ -192,7 +205,8 @@ export function AddDocumentModal({newVersion, children}: {newVersion?: boolean,
type="submit"
className="w-full lg:w-1/2"
disabled={uploading || !currentFile}
- loading={uploading}>
+ loading={uploading}
+ >
{uploading ? "Uploading..." : "Upload Document"}
</Button>
</div>
diff --git a/components/documents/document-card.tsx b/components/documents/document-card.tsx
index c310a97d..5b68d3ec 100644
--- a/components/documents/document-card.tsx
+++ b/components/documents/document-card.tsx
@@ -1,4 +1,9 @@
-import { copyToClipboard, getExtension, nFormatter, timeAgo } from "@/lib/utils";
+import {
+ copyToClipboard,
+ getExtension,
+ nFormatter,
+ timeAgo,
+} from "@/lib/utils";
import Link from "next/link";
import { DocumentWithLinksAndLinkCountAndViewCount } from "@/lib/types";
import Copy from "@/components/shared/icons/copy";
@@ -10,13 +15,13 @@ export default function DocumentsCard({
}: {
document: DocumentWithLinksAndLinkCountAndViewCount;
}) {
-
function handleCopyToClipboard(id: string) {
- copyToClipboard(`${process.env.NEXT_PUBLIC_BASE_URL}/view/${id}`, "Link copied to clipboard.");
+ copyToClipboard(
+ `${process.env.NEXT_PUBLIC_BASE_URL}/view/${id}`,
+ "Link copied to clipboard.",
+ );
}
-
-
return (
<li className="relative rounded-lg p-3 border-0 dark:bg-secondary ring-1 ring-gray-200 dark:ring-gray-700 transition-all hover:ring-gray-400 hover:dark:ring-gray-500 hover:bg-secondary sm:p-4 flex justify-between items-center">
<div className="min-w-0 flex shrink items-center space-x-4">
@@ -56,7 +61,7 @@ export default function DocumentsCard({
<p className="truncate">{`${document._count.links} ${
document._count.links === 1 ? "Link" : "Links"
}`}</p>
- { document._count.versions > 1 ? (
+ {document._count.versions > 1 ? (
<>
<p>•</p>
<p className="truncate">{`${document._count.versions} Versions`}</p>
@@ -81,4 +86,4 @@ export default function DocumentsCard({
</Link>
</li>
);
-}
\ No newline at end of file
+}
diff --git a/components/documents/process-status-bar.tsx b/components/documents/process-status-bar.tsx
index 465ad022..608978e9 100644
--- a/components/documents/process-status-bar.tsx
+++ b/components/documents/process-status-bar.tsx
@@ -3,10 +3,14 @@ import ErrorPage from "next/error";
import { useDocumentProcessingStatus } from "@/lib/swr/use-document";
import { useEffect, useState } from "react";
-export default function ProcessStatusBar({ documentVersionId }: { documentVersionId: string }) {
+export default function ProcessStatusBar({
+ documentVersionId,
+}: {
+ documentVersionId: string;
+}) {
const { status, loading, error } =
useDocumentProcessingStatus(documentVersionId);
-
+
const [progress, setProgress] = useState<number>(0);
const [text, setText] = useState<string>("");
@@ -18,19 +22,18 @@ export default function ProcessStatusBar({ documentVersionId }: { documentVersio
setText("Processing complete");
} else {
setText(
- `${status.currentPageCount} / ${status.totalPages} pages processed`
+ `${status.currentPageCount} / ${status.totalPages} pages processed`,
);
}
}
}, [status]);
-
if (error && error.status === 404) {
return <ErrorPage statusCode={404} />;
}
if (loading) {
- return <Progress value={0} />
+ return <Progress value={0} />;
}
return <Progress value={progress} text={text} className="w-[60%]" />;
diff --git a/components/documents/stats-card.tsx b/components/documents/stats-card.tsx
index 5bbbb957..413a773e 100644
--- a/components/documents/stats-card.tsx
+++ b/components/documents/stats-card.tsx
@@ -37,12 +37,12 @@ export default function StatsCard() {
stats?.total_duration == null
? "46"
: stats?.total_duration < 60000
- ? `${Math.round(stats?.total_duration / 1000)}`
- : `${Math.floor(stats?.total_duration / 60000)}:${
- Math.round((stats?.total_duration % 60000) / 1000) < 10
- ? `0${Math.round((stats?.total_duration % 60000) / 1000)}`
- : Math.round((stats?.total_duration % 60000) / 1000)
- }`,
+ ? `${Math.round(stats?.total_duration / 1000)}`
+ : `${Math.floor(stats?.total_duration / 60000)}:${
+ Math.round((stats?.total_duration % 60000) / 1000) < 10
+ ? `0${Math.round((stats?.total_duration % 60000) / 1000)}`
+ : Math.round((stats?.total_duration % 60000) / 1000)
+ }`,
unit: stats?.total_duration! < 60000 ? "seconds" : "minutes",
active: stats?.total_duration ? true : false,
},
diff --git a/components/documents/stats-chart.tsx b/components/documents/stats-chart.tsx
index 392a0813..989337e6 100644
--- a/components/documents/stats-chart.tsx
+++ b/components/documents/stats-chart.tsx
@@ -2,7 +2,6 @@ import { useStats } from "@/lib/swr/use-stats";
import ErrorPage from "next/error";
import BarChartComponent from "../charts/bar-chart";
-
export default function StatsChart({
documentId,
totalPagesMax = 0,
@@ -35,14 +34,13 @@ export default function StatsChart({
if (swrData) {
swrData.data.forEach((dataItem) => {
const pageIndex = durationData.findIndex(
- (item) => item.pageNumber === dataItem.pageNumber
+ (item) => item.pageNumber === dataItem.pageNumber,
);
-
if (pageIndex !== -1) {
// If page exists in the initialized array, update its data
const versionIndex = durationData[pageIndex].data.findIndex(
- (v) => v.versionNumber === dataItem.versionNumber
+ (v) => v.versionNumber === dataItem.versionNumber,
);
if (versionIndex === -1) {
// If this version number doesn't exist, add it
@@ -73,7 +71,7 @@ export default function StatsChart({
// Sort by page number
durationData.sort(
- (a, b) => parseInt(a.pageNumber) - parseInt(b.pageNumber)
+ (a, b) => parseInt(a.pageNumber) - parseInt(b.pageNumber),
);
}
diff --git a/components/documents/stats-element-placeholder.tsx b/components/documents/stats-element-placeholder.tsx
index cebf3224..4e506fdf 100644
--- a/components/documents/stats-element-placeholder.tsx
+++ b/components/documents/stats-element-placeholder.tsx
@@ -1,11 +1,15 @@
import { classNames } from "@/lib/utils";
-export default function StatsElementPlaceholder({ statIdx }: { statIdx: number }) {
+export default function StatsElementPlaceholder({
+ statIdx,
+}: {
+ statIdx: number;
+}) {
return (
<div
className={classNames(
statIdx % 2 === 1 ? "sm:border-l" : statIdx === 2 ? "lg:border-l" : "",
- "border-t border-foreground/5 py-6 px-4 sm:px-6 lg:px-8"
+ "border-t border-foreground/5 py-6 px-4 sm:px-6 lg:px-8",
)}
>
<div className="h-4 w-full animate-pulse rounded-md bg-gray-200 dark:bg-gray-800" />
diff --git a/components/documents/stats-element.tsx b/components/documents/stats-element.tsx
index 7e95a301..b1cb3462 100644
--- a/components/documents/stats-element.tsx
+++ b/components/documents/stats-element.tsx
@@ -17,7 +17,7 @@ export default function StatsElement({ stat, statIdx }: StatsElementProps) {
key={statIdx}
className={classNames(
statIdx % 2 === 1 ? "sm:border-l" : statIdx === 2 ? "lg:border-l" : "",
- "border-t border-foreground/5 py-6 px-4 sm:px-6 lg:px-8"
+ "border-t border-foreground/5 py-6 px-4 sm:px-6 lg:px-8",
)}
>
<p
@@ -25,7 +25,7 @@ export default function StatsElement({ stat, statIdx }: StatsElementProps) {
!stat.active
? "text-gray-300 dark:text-gray-700"
: "text-muted-foreground",
- "text-sm font-medium leading-6"
+ "text-sm font-medium leading-6",
)}
>
{stat.name}
@@ -33,8 +33,10 @@ export default function StatsElement({ stat, statIdx }: StatsElementProps) {
<p className="mt-2 flex items-baseline gap-x-2">
<span
className={classNames(
- !stat.active ? "text-gray-300 dark:text-gray-700" : "text-foreground",
- "text-4xl font-semibold tracking-tight "
+ !stat.active
+ ? "text-gray-300 dark:text-gray-700"
+ : "text-foreground",
+ "text-4xl font-semibold tracking-tight ",
)}
>
{stat.value}
@@ -42,8 +44,10 @@ export default function StatsElement({ stat, statIdx }: StatsElementProps) {
{stat.unit ? (
<span
className={classNames(
- !stat.active ? "text-gray-300 dark:text-gray-700" : "text-muted-foreground",
- "text-sm"
+ !stat.active
+ ? "text-gray-300 dark:text-gray-700"
+ : "text-muted-foreground",
+ "text-sm",
)}
>
{stat.unit}
diff --git a/components/domains/domain-card.tsx b/components/domains/domain-card.tsx
index 71e08c62..cce34ed2 100644
--- a/components/domains/domain-card.tsx
+++ b/components/domains/domain-card.tsx
@@ -30,7 +30,7 @@ export default function DomainCard({
`/api/teams/${teamInfo?.currentTeam?.id}/domains/${domain}`,
{
method: "DELETE",
- }
+ },
);
if (!response.ok) {
@@ -51,7 +51,8 @@ export default function DomainCard({
href={`http://${domain}`}
target="_blank"
rel="noreferrer"
- className="flex items-center space-x-2">
+ className="flex items-center space-x-2"
+ >
<p className="flex items-center text-xl font-semibold">
{domain}
</p>
@@ -65,15 +66,17 @@ export default function DomainCard({
loading={loading}
onClick={() => {
mutate(
- `/api/teams/${teamInfo?.currentTeam?.id}/domains/${domain}/verify`
+ `/api/teams/${teamInfo?.currentTeam?.id}/domains/${domain}/verify`,
);
- }}>
+ }}
+ >
Refresh
</Button>
<Button
variant="destructive"
onClick={handleDelete}
- loading={deleting}>
+ loading={deleting}
+ >
Delete
</Button>
</div>
diff --git a/components/domains/domain-configuration.tsx b/components/domains/domain-configuration.tsx
index c5795357..a41b4336 100644
--- a/components/domains/domain-configuration.tsx
+++ b/components/domains/domain-configuration.tsx
@@ -16,7 +16,7 @@ export const InlineSnippet = ({
<span
className={cn(
"inline-block rounded-md bg-blue-100 px-1 py-0.5 font-mono text-blue-900 dark:bg-blue-900 dark:text-blue-100",
- className
+ className,
)}
>
{children}
@@ -26,8 +26,12 @@ export const InlineSnippet = ({
export default function DomainConfiguration({ domain }: { domain: string }) {
const { status, domainJson } = useDomainStatus({ domain });
- const subdomain = domainJson ? getSubdomain(domainJson.name, domainJson.apexName): null;
- const [recordType, setRecordType] = useState<"CNAME" | "A">(!!subdomain ? "CNAME" : "A");
+ const subdomain = domainJson
+ ? getSubdomain(domainJson.name, domainJson.apexName)
+ : null;
+ const [recordType, setRecordType] = useState<"CNAME" | "A">(
+ !!subdomain ? "CNAME" : "A",
+ );
if (!status || status === "Valid Configuration" || !domainJson) return null;
@@ -55,7 +59,9 @@ export default function DomainConfiguration({ domain }: { domain: string }) {
<p className="mt-2 font-mono text-sm">
{txtVerification.domain.slice(
0,
- txtVerification.domain.length - domainJson.apexName.length - 1
+ txtVerification.domain.length -
+ domainJson.apexName.length -
+ 1,
)}
</p>
</div>
@@ -126,9 +132,7 @@ export default function DomainConfiguration({ domain }: { domain: string }) {
<div>
<p className="text-sm font-bold">Value</p>
<p className="mt-2 font-mono text-sm">
- {recordType === "A"
- ? `76.76.21.21`
- : `cname.vercel-dns.com`}
+ {recordType === "A" ? `76.76.21.21` : `cname.vercel-dns.com`}
</p>
</div>
<div>
diff --git a/components/domains/use-domain-status.ts b/components/domains/use-domain-status.ts
index 3b0c5f62..dece15b7 100644
--- a/components/domains/use-domain-status.ts
+++ b/components/domains/use-domain-status.ts
@@ -16,7 +16,7 @@ export function useDomainStatus({ domain }: { domain: string }) {
revalidateOnMount: true,
refreshInterval: 5000,
keepPreviousData: true,
- }
+ },
);
return {
diff --git a/components/emails/deleted-domain.tsx b/components/emails/deleted-domain.tsx
index 67790d8a..3a0125fa 100644
--- a/components/emails/deleted-domain.tsx
+++ b/components/emails/deleted-domain.tsx
@@ -10,7 +10,6 @@ import {
Section,
Text,
Tailwind,
- Link,
Hr,
} from "@react-email/components";
diff --git a/components/investors/stats.tsx b/components/investors/stats.tsx
index 66b73348..1ff11cfd 100644
--- a/components/investors/stats.tsx
+++ b/components/investors/stats.tsx
@@ -1,4 +1,4 @@
-export default function Stats({ angelsLength }: { angelsLength: any; }) {
+export default function Stats({ angelsLength }: { angelsLength: any }) {
return (
<div className="relative mt-10">
<div className="absolute inset-0 h-1/2" />
diff --git a/components/investors/table.tsx b/components/investors/table.tsx
index 760bcd9d..1e6f2396 100644
--- a/components/investors/table.tsx
+++ b/components/investors/table.tsx
@@ -18,15 +18,10 @@ interface Fields {
websiteUrl: string;
twitterImageUrl: string;
openSourceInvestments: string;
- checkSize:
- | "Unknown"
- | "$5k - $50k"
- | "$50k+"
- | "$100k+"
- | "$250k+"
+ checkSize: "Unknown" | "$5k - $50k" | "$50k+" | "$100k+" | "$250k+";
}
-export default function Table({ investors }: { investors: Investor[]; }) {
+export default function Table({ investors }: { investors: Investor[] }) {
return (
<div>
<table className="min-w-full md:divide-y bg-gray-100 md:bg-transparent divide-gray-300 rounded-lg overflow-hidden md:rounded-none">
@@ -124,15 +119,15 @@ export default function Table({ investors }: { investors: Investor[]; }) {
person.fields.checkSize === "Unknown"
? "bg-gray-100 text-gray-800"
: person.fields.checkSize === "$5k - $50k"
- ? "bg-green-100 text-green-800"
- : person.fields.checkSize === "$50k+"
- ? "bg-blue-100 text-blue-800"
- : person.fields.checkSize === "$100k+"
- ? "bg-purple-100 text-purple-800"
- : person.fields.checkSize === "$250k+"
- ? "bg-yellow-100 text-yellow-800"
- : "bg-orange-100 text-orange-800",
- "inline-flex rounded-full px-[9px] py-[2px] text-xs font-semibold leading-5"
+ ? "bg-green-100 text-green-800"
+ : person.fields.checkSize === "$50k+"
+ ? "bg-blue-100 text-blue-800"
+ : person.fields.checkSize === "$100k+"
+ ? "bg-purple-100 text-purple-800"
+ : person.fields.checkSize === "$250k+"
+ ? "bg-yellow-100 text-yellow-800"
+ : "bg-orange-100 text-orange-800",
+ "inline-flex rounded-full px-[9px] py-[2px] text-xs font-semibold leading-5",
)}
>
{person.fields.checkSize}
diff --git a/components/layouts/app.tsx b/components/layouts/app.tsx
index e3f1d434..b5e19975 100644
--- a/components/layouts/app.tsx
+++ b/components/layouts/app.tsx
@@ -1,7 +1,6 @@
import Sidebar from "../Sidebar";
-
-export default function AppLayout({children}: {children: React.ReactNode}) {
+export default function AppLayout({ children }: { children: React.ReactNode }) {
return (
<div>
<div className="flex flex-col lg:flex-row min-h-screen bg-gray-50 dark:bg-black">
@@ -12,4 +11,4 @@ export default function AppLayout({children}: {children: React.ReactNode}) {
</div>
</div>
);
-}
\ No newline at end of file
+}
diff --git a/components/links/link-sheet/allow-download-section.tsx b/components/links/link-sheet/allow-download-section.tsx
index a54e350d..2d38dd51 100644
--- a/components/links/link-sheet/allow-download-section.tsx
+++ b/components/links/link-sheet/allow-download-section.tsx
@@ -30,7 +30,7 @@ export default function AllowDownloadSection({
<h2
className={cn(
"text-sm font-medium leading-6",
- enabled ? "text-foreground" : "text-muted-foreground"
+ enabled ? "text-foreground" : "text-muted-foreground",
)}
>
Allow downloading
diff --git a/components/links/link-sheet/allow-notification.tsx b/components/links/link-sheet/allow-notification.tsx
index 833bdae6..0b254181 100644
--- a/components/links/link-sheet/allow-notification.tsx
+++ b/components/links/link-sheet/allow-notification.tsx
@@ -30,7 +30,7 @@ export default function AllowNotificationSection({
<h2
className={cn(
"text-sm font-medium leading-6",
- enabled ? "text-foreground" : "text-muted-foreground"
+ enabled ? "text-foreground" : "text-muted-foreground",
)}
>
Receive email notification
diff --git a/components/links/link-sheet/domain-section.tsx b/components/links/link-sheet/domain-section.tsx
index 04029c49..38262814 100644
--- a/components/links/link-sheet/domain-section.tsx
+++ b/components/links/link-sheet/domain-section.tsx
@@ -1,10 +1,9 @@
-import { Dispatch, SetStateAction, useState, useEffect } from "react";
+import { Dispatch, SetStateAction, useState } from "react";
import { cn } from "@/lib/utils";
import { DEFAULT_LINK_TYPE } from ".";
import { Label } from "@/components/ui/label";
import { Domain } from "@prisma/client";
import { AddDomainModal } from "@/components/domains/add-domain-modal";
-import { Button } from "@/components/ui/button";
import { mutate } from "swr";
import Link from "next/link";
import { useTeam } from "@/context/team-context";
@@ -53,8 +52,9 @@ export default function DomainSection({
"w-48 rounded-l-md border border-r-0 border-border bg-secondary px-5 text-sm text-secondary-foreground focus:border-border focus:outline-none focus:ring-0",
data.domain && data.domain !== "papermark.io"
? ""
- : "rounded-r-md border-r-1"
- )}>
+ : "rounded-r-md border-r-1",
+ )}
+ >
<option key="papermark.io" value="papermark.io">
papermark.io
</option>
@@ -77,13 +77,13 @@ export default function DomainSection({
pattern="[\p{L}\p{N}\p{Pd}\/]+"
onInvalid={(e) => {
e.currentTarget.setCustomValidity(
- "Only letters, numbers, '-', and '/' are allowed."
+ "Only letters, numbers, '-', and '/' are allowed.",
);
}}
autoComplete="off"
className={cn(
"hidden w-full rounded-r-md border-0 py-1.5 text-foreground bg-background shadow-sm ring-1 ring-inset ring-input placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-gray-400 sm:text-sm sm:leading-6",
- data.domain && data.domain !== "papermark.io" ? "flex" : ""
+ data.domain && data.domain !== "papermark.io" ? "flex" : "",
)}
placeholder="deck"
onChange={(e) => {
@@ -101,7 +101,8 @@ export default function DomainSection({
<Link
className="underline hover:text-red-500/80"
href="/settings/domains"
- target="_blank">
+ target="_blank"
+ >
Verify now
</Link>
</div>
diff --git a/components/links/link-sheet/email-protection-section.tsx b/components/links/link-sheet/email-protection-section.tsx
index a9d53a9e..2ea159ea 100644
--- a/components/links/link-sheet/email-protection-section.tsx
+++ b/components/links/link-sheet/email-protection-section.tsx
@@ -3,9 +3,13 @@ import { Switch } from "@/components/ui/switch";
import { cn } from "@/lib/utils";
import { DEFAULT_LINK_TYPE } from ".";
-
-
-export default function EmailProtectionSection({data, setData}: {data: DEFAULT_LINK_TYPE, setData: Dispatch<SetStateAction<DEFAULT_LINK_TYPE>>}) {
+export default function EmailProtectionSection({
+ data,
+ setData,
+}: {
+ data: DEFAULT_LINK_TYPE;
+ setData: Dispatch<SetStateAction<DEFAULT_LINK_TYPE>>;
+}) {
const { emailProtected } = data;
const [enabled, setEnabled] = useState<boolean>(true);
@@ -26,17 +30,14 @@ export default function EmailProtectionSection({data, setData}: {data: DEFAULT_L
<h2
className={cn(
"text-sm font-medium leading-6",
- enabled ? "text-foreground" : "text-muted-foreground"
+ enabled ? "text-foreground" : "text-muted-foreground",
)}
>
Require email to view
</h2>
</div>
- <Switch
- checked={enabled}
- onCheckedChange={handleEnableProtection}
- />
+ <Switch checked={enabled} onCheckedChange={handleEnableProtection} />
</div>
</div>
);
-}
\ No newline at end of file
+}
diff --git a/components/links/link-sheet/expiration-section.tsx b/components/links/link-sheet/expiration-section.tsx
index 9d5347e2..ebea8d32 100644
--- a/components/links/link-sheet/expiration-section.tsx
+++ b/components/links/link-sheet/expiration-section.tsx
@@ -5,9 +5,13 @@ import { FADE_IN_ANIMATION_SETTINGS } from "@/lib/constants";
import { cn, getDateTimeLocal } from "@/lib/utils";
import { DEFAULT_LINK_TYPE } from ".";
-
-
-export default function ExpirationSection({data, setData}: {data: DEFAULT_LINK_TYPE, setData: Dispatch<SetStateAction<DEFAULT_LINK_TYPE>>}) {
+export default function ExpirationSection({
+ data,
+ setData,
+}: {
+ data: DEFAULT_LINK_TYPE;
+ setData: Dispatch<SetStateAction<DEFAULT_LINK_TYPE>>;
+}) {
const { expiresAt } = data;
const [enabled, setEnabled] = useState<boolean>(false);
@@ -30,7 +34,7 @@ export default function ExpirationSection({data, setData}: {data: DEFAULT_LINK_T
<h2
className={cn(
"text-sm font-medium leading-6",
- enabled ? "text-foreground" : "text-muted-foreground"
+ enabled ? "text-foreground" : "text-muted-foreground",
)}
>
Expiration Date
@@ -56,4 +60,4 @@ export default function ExpirationSection({data, setData}: {data: DEFAULT_LINK_T
)}
</div>
);
-}
\ No newline at end of file
+}
diff --git a/components/links/link-sheet/password-section.tsx b/components/links/link-sheet/password-section.tsx
index c38ad8bc..51cb5aff 100644
--- a/components/links/link-sheet/password-section.tsx
+++ b/components/links/link-sheet/password-section.tsx
@@ -2,14 +2,18 @@ import { Dispatch, SetStateAction, useEffect, useState } from "react";
import { Switch } from "@/components/ui/switch";
import { motion } from "framer-motion";
import { FADE_IN_ANIMATION_SETTINGS } from "@/lib/constants";
-import Eye from "@/components/shared/icons/eye"
-import EyeOff from "@/components/shared/icons/eye-off"
+import Eye from "@/components/shared/icons/eye";
+import EyeOff from "@/components/shared/icons/eye-off";
import { cn } from "@/lib/utils";
import { DEFAULT_LINK_TYPE } from ".";
-
-
-export default function PasswordSection({data, setData}: {data: DEFAULT_LINK_TYPE, setData: Dispatch<SetStateAction<DEFAULT_LINK_TYPE>>}) {
+export default function PasswordSection({
+ data,
+ setData,
+}: {
+ data: DEFAULT_LINK_TYPE;
+ setData: Dispatch<SetStateAction<DEFAULT_LINK_TYPE>>;
+}) {
const { password } = data;
const [enabled, setEnabled] = useState<boolean>(false);
const [showPassword, setShowPassword] = useState<boolean>(false);
@@ -33,7 +37,7 @@ export default function PasswordSection({data, setData}: {data: DEFAULT_LINK_TYP
<h2
className={cn(
"text-sm font-medium leading-6",
- enabled ? "text-foreground" : "text-muted-foreground"
+ enabled ? "text-foreground" : "text-muted-foreground",
)}
>
Require password to view
@@ -64,13 +68,19 @@ export default function PasswordSection({data, setData}: {data: DEFAULT_LINK_TYP
className="absolute inset-y-0 right-0 flex items-center pr-3"
>
{showPassword ? (
- <Eye className="h-4 w-4 text-muted-foreground" aria-hidden="true" />
+ <Eye
+ className="h-4 w-4 text-muted-foreground"
+ aria-hidden="true"
+ />
) : (
- <EyeOff className="h-4 w-4 text-muted-foreground" aria-hidden="true" />
+ <EyeOff
+ className="h-4 w-4 text-muted-foreground"
+ aria-hidden="true"
+ />
)}
</button>
</motion.div>
)}
</div>
);
-}
\ No newline at end of file
+}
diff --git a/components/links/links-visitors.tsx b/components/links/links-visitors.tsx
index 5bd68741..706405f6 100644
--- a/components/links/links-visitors.tsx
+++ b/components/links/links-visitors.tsx
@@ -4,11 +4,15 @@ import { TableCell, TableRow } from "@/components/ui/table";
import { useLinkVisits } from "@/lib/swr/use-link";
import { Gauge } from "@/components/ui/gauge";
-
-
-export default function LinksVisitors({linkId, linkName}: {linkId: string, linkName: string}) {
+export default function LinksVisitors({
+ linkId,
+ linkName,
+}: {
+ linkId: string;
+ linkName: string;
+}) {
const { views } = useLinkVisits(linkId);
-
+
return (
<>
{views
@@ -115,4 +119,3 @@ export default function LinksVisitors({linkId, linkName}: {linkId: string, linkN
</>
);
}
-
diff --git a/components/settings/navbar.tsx b/components/settings/navbar.tsx
index 486901ad..7b95232c 100644
--- a/components/settings/navbar.tsx
+++ b/components/settings/navbar.tsx
@@ -32,9 +32,10 @@ export default function Navbar({ current }: { current?: string }) {
current === tab.name
? "border-foreground text-foreground"
: "border-transparent text-muted-foreground hover:border-foreground hover:text-foreground",
- "whitespace-nowrap border-b-2 py-4 px-1 text-sm font-medium"
+ "whitespace-nowrap border-b-2 py-4 px-1 text-sm font-medium",
)}
- aria-current={current === tab.name ? "page" : undefined}>
+ aria-current={current === tab.name ? "page" : undefined}
+ >
{tab.name}
</Link>
))}
diff --git a/components/teams/add-team-modal.tsx b/components/teams/add-team-modal.tsx
index 5bb7fe65..be1224c7 100644
--- a/components/teams/add-team-modal.tsx
+++ b/components/teams/add-team-modal.tsx
@@ -55,7 +55,8 @@ export function AddTeamModal({ children }: { children: React.ReactNode }) {
<DialogTrigger asChild>{children}</DialogTrigger>
<DialogContent
className="text-foreground bg-background"
- onClick={(e) => e.stopPropagation()}>
+ onClick={(e) => e.stopPropagation()}
+ >
<DialogHeader>
<DialogTitle>Create a Team</DialogTitle>
<DialogDescription className="py-2 mb-1 text-sm text-muted-foreground">
@@ -65,7 +66,8 @@ export function AddTeamModal({ children }: { children: React.ReactNode }) {
<form
onSubmit={handleCreateTeam}
className="flex flex-col gap-8 mt-4"
- onClick={(e) => e.stopPropagation()}>
+ onClick={(e) => e.stopPropagation()}
+ >
<div className="flex flex-col gap-3">
<div>
<Label htmlFor="team">Team name</Label>
diff --git a/components/teams/delete-team-modal.tsx b/components/teams/delete-team-modal.tsx
index ceb075a6..a307dc64 100644
--- a/components/teams/delete-team-modal.tsx
+++ b/components/teams/delete-team-modal.tsx
@@ -63,7 +63,8 @@ export function DeleteTeamModal({ children }: { children: React.ReactNode }) {
<DialogTrigger asChild>{children}</DialogTrigger>
<DialogContent
className="text-foreground bg-background"
- onClick={(e) => e.stopPropagation()}>
+ onClick={(e) => e.stopPropagation()}
+ >
<DialogHeader>
<DialogTitle>Delete Team</DialogTitle>
<DialogDescription className="py-2 mb-1 text-sm text-muted-foreground">
@@ -74,7 +75,8 @@ export function DeleteTeamModal({ children }: { children: React.ReactNode }) {
<form
onSubmit={handleDeleteTeam}
className="flex flex-col gap-8 mt-4"
- onClick={(e) => e.stopPropagation()}>
+ onClick={(e) => e.stopPropagation()}
+ >
<div className="flex flex-col gap-3">
<div>
<Label htmlFor="team">
diff --git a/components/teams/select-team.tsx b/components/teams/select-team.tsx
index cf93aef6..d53c0d7b 100644
--- a/components/teams/select-team.tsx
+++ b/components/teams/select-team.tsx
@@ -1,12 +1,9 @@
import React, { useEffect, useRef, useState } from "react";
import { Check, Loader, PlusIcon } from "lucide-react";
import { TeamContextType, useTeam } from "@/context/team-context";
-import { AddTeamModal } from "./add-team-modal";
import { ChevronUpDownIcon } from "@heroicons/react/20/solid";
import { Team } from "@/lib/types";
import { useRouter } from "next/router";
-import { AddTeamMembers } from "./add-team-member-modal";
-import { Button } from "../ui/button";
import Link from "next/link";
const SelectTeam = ({ teams, currentTeam, isLoading }: TeamContextType) => {
diff --git a/components/theme-provider.tsx b/components/theme-provider.tsx
index fde5f4eb..b0ff2660 100644
--- a/components/theme-provider.tsx
+++ b/components/theme-provider.tsx
@@ -1,9 +1,9 @@
-"use client"
-
-import * as React from "react"
-import { ThemeProvider as NextThemesProvider } from "next-themes"
-import { type ThemeProviderProps } from "next-themes/dist/types"
-
+"use client";
+
+import * as React from "react";
+import { ThemeProvider as NextThemesProvider } from "next-themes";
+import { type ThemeProviderProps } from "next-themes/dist/types";
+
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
- return <NextThemesProvider {...props}>{children}</NextThemesProvider>
-}
\ No newline at end of file
+ return <NextThemesProvider {...props}>{children}</NextThemesProvider>;
+}
diff --git a/components/theme-toggle.tsx b/components/theme-toggle.tsx
index a0a85695..77987d66 100644
--- a/components/theme-toggle.tsx
+++ b/components/theme-toggle.tsx
@@ -39,5 +39,3 @@ export function ModeToggle() {
</DropdownMenu>
);
}
-
-
diff --git a/components/view/access-form/email-section.tsx b/components/view/access-form/email-section.tsx
index 14ddb1db..12064cd2 100644
--- a/components/view/access-form/email-section.tsx
+++ b/components/view/access-form/email-section.tsx
@@ -1,7 +1,6 @@
import { Dispatch, SetStateAction } from "react";
import { DEFAULT_ACCESS_FORM_TYPE } from ".";
-
export default function EmailSection({
data,
setData,
@@ -33,7 +32,9 @@ export default function EmailSection({
}}
aria-invalid="true"
/>
- <p className="text-sm text-gray-600">This data will be shared with the sender.</p>
+ <p className="text-sm text-gray-600">
+ This data will be shared with the sender.
+ </p>
</div>
</div>
);
diff --git a/components/view/access-form/index.tsx b/components/view/access-form/index.tsx
index c2b45a59..5422f274 100644
--- a/components/view/access-form/index.tsx
+++ b/components/view/access-form/index.tsx
@@ -30,7 +30,6 @@ export default function AccessForm({
requirePassword: boolean;
isLoading: boolean;
}) {
-
useEffect(() => {
const userEmail = email;
if (userEmail) {
diff --git a/components/visitors/visitor-chart.tsx b/components/visitors/visitor-chart.tsx
index 241c7ee1..0f94b1f3 100644
--- a/components/visitors/visitor-chart.tsx
+++ b/components/visitors/visitor-chart.tsx
@@ -30,7 +30,7 @@ export default function VisitorChart({
durationData = durationData.map((item) => {
const swrItem = swrData.data.find(
- (data) => data.pageNumber === item.pageNumber
+ (data) => data.pageNumber === item.pageNumber,
);
return swrItem ? swrItem : item;
});
diff --git a/components/visitors/visitors-table.tsx b/components/visitors/visitors-table.tsx
index fc76dd2f..36e211f1 100644
--- a/components/visitors/visitors-table.tsx
+++ b/components/visitors/visitors-table.tsx
@@ -11,16 +11,16 @@ import {
CollapsibleContent,
CollapsibleTrigger,
} from "@/components/ui/collapsible";
-import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
+import { Avatar, AvatarFallback } from "@/components/ui/avatar";
import { Gauge } from "@/components/ui/gauge";
import { useDocumentVisits } from "@/lib/swr/use-document";
-import { durationFormat, nFormatter, timeAgo } from "@/lib/utils";
+import { durationFormat, timeAgo } from "@/lib/utils";
import { Skeleton } from "../ui/skeleton";
import ChevronDown from "../shared/icons/chevron-down";
import VisitorChart from "./visitor-chart";
-export default function VisitorsTable({numPages}: {numPages: number}) {
+export default function VisitorsTable({ numPages }: { numPages: number }) {
const { views } = useDocumentVisits();
return (
@@ -46,7 +46,7 @@ export default function VisitorsTable({numPages}: {numPages: number}) {
<>
<TableRow key={view.id} className="group/row">
{/* Name */}
- <TableCell className="">
+ <TableCell className="">
<div className="flex items-center sm:space-x-3 overflow-visible">
<Avatar className="flex-shrink-0 hidden sm:inline-flex">
<AvatarFallback>
@@ -56,7 +56,9 @@ export default function VisitorsTable({numPages}: {numPages: number}) {
<div className="min-w-0 flex-1">
<div className="focus:outline-none">
<p className="text-sm font-medium text-gray-800 dark:text-gray-200 overflow-visible">
- {view.viewerEmail? view.viewerEmail : "Anonymous"}
+ {view.viewerEmail
+ ? view.viewerEmail
+ : "Anonymous"}
</p>
<p className="text-sm text-muted-foreground/60">
{view.link.name ? view.link.name : view.linkId}
@@ -83,11 +85,7 @@ export default function VisitorsTable({numPages}: {numPages: number}) {
</TableCell>
{/* Last Viewed */}
<TableCell className="text-sm text-muted-foreground">
- <time
- dateTime={new Date(
- view.viewedAt
- ).toISOString()}
- >
+ <time dateTime={new Date(view.viewedAt).toISOString()}>
{timeAgo(view.viewedAt)}
</time>
</TableCell>
@@ -105,7 +103,7 @@ export default function VisitorsTable({numPages}: {numPages: number}) {
<TableRow className="hover:bg-transparent">
<TableCell colSpan={5}>
<div>
- <VisitorChart
+ <VisitorChart
documentId={view.documentId}
viewId={view.id}
totalPages={numPages}
diff --git a/components/welcome/intro.tsx b/components/welcome/intro.tsx
index be1c75a8..fab78747 100644
--- a/components/welcome/intro.tsx
+++ b/components/welcome/intro.tsx
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
import { motion } from "framer-motion";
-import { STAGGER_CHILD_VARIANTS } from "@/lib/constants"
+import { STAGGER_CHILD_VARIANTS } from "@/lib/constants";
import { Button } from "../ui/button";
export default function Intro() {
@@ -42,7 +42,8 @@ export default function Intro() {
variants={STAGGER_CHILD_VARIANTS}
// className="rounded px-10 py-2 font-medium transition-colors text-gray-900 bg-gray-100 hover:text-gray-100 hover:bg-gray-500"
>
- <Button className="px-10 font-medium text-base"
+ <Button
+ className="px-10 font-medium text-base"
onClick={() =>
router.push({
pathname: "/welcome",
diff --git a/components/welcome/next.tsx b/components/welcome/next.tsx
index 47818ec3..2cb75a06 100644
--- a/components/welcome/next.tsx
+++ b/components/welcome/next.tsx
@@ -1,6 +1,9 @@
import { useRouter } from "next/router";
import { motion } from "framer-motion";
-import { DocumentIcon, PresentationChartBarIcon } from "@heroicons/react/24/outline";
+import {
+ DocumentIcon,
+ PresentationChartBarIcon,
+} from "@heroicons/react/24/outline";
import { STAGGER_CHILD_VARIANTS } from "@/lib/constants";
export default function Next() {
diff --git a/components/welcome/upload.tsx b/components/welcome/upload.tsx
index 921abfae..bf17767d 100644
--- a/components/welcome/upload.tsx
+++ b/components/welcome/upload.tsx
@@ -82,7 +82,7 @@ export default function Upload() {
const saveDocumentToDatabase = async (
blob: PutBlobResult,
- numPages?: number
+ numPages?: number,
) => {
// create a document in the database with the blob url
const response = await fetch(
@@ -97,7 +97,7 @@ export default function Upload() {
url: blob.url,
numPages: numPages,
}),
- }
+ },
);
if (!response.ok) {
@@ -116,7 +116,7 @@ export default function Upload() {
const handleContinue = (id: string) => {
copyToClipboard(
`${process.env.NEXT_PUBLIC_BASE_URL}/view/${id}`,
- "Link copied to clipboard. Redirecting to document page..."
+ "Link copied to clipboard. Redirecting to document page...",
);
setTimeout(() => {
router.push(`/documents/${currentDocId}`);
@@ -142,10 +142,12 @@ export default function Upload() {
initial="hidden"
animate="show"
exit="hidden"
- transition={{ duration: 0.3, type: "spring" }}>
+ transition={{ duration: 0.3, type: "spring" }}
+ >
<motion.div
variants={STAGGER_CHILD_VARIANTS}
- className="flex flex-col items-center space-y-10 text-center">
+ className="flex flex-col items-center space-y-10 text-center"
+ >
<h1 className="font-display text-3xl font-semibold text-foreground transition-colors sm:text-4xl">
{`Upload your ${router.query.type}`}
</h1>
@@ -155,7 +157,8 @@ export default function Upload() {
<form
encType="multipart/form-data"
onSubmit={handleBrowserUpload}
- className="flex flex-col">
+ className="flex flex-col"
+ >
<div className="space-y-12">
<div className="pb-6">
<div className="mt-10 grid grid-cols-1 gap-x-6 gap-y-8 sm:grid-cols-6">
@@ -171,7 +174,8 @@ export default function Upload() {
<Button
type="submit"
className="w-full"
- disabled={uploading || !currentFile}>
+ disabled={uploading || !currentFile}
+ >
{uploading ? "Uploading..." : "Upload Document"}
</Button>
</div>
@@ -197,10 +201,12 @@ export default function Upload() {
initial="hidden"
animate="show"
exit="hidden"
- transition={{ duration: 0.3, type: "spring" }}>
+ transition={{ duration: 0.3, type: "spring" }}
+ >
<motion.div
variants={STAGGER_CHILD_VARIANTS}
- className="flex flex-col items-center space-y-10 text-center">
+ className="flex flex-col items-center space-y-10 text-center"
+ >
<h1 className="font-display text-3xl font-semibold text-foreground transition-colors sm:text-4xl">
Share your unique link
</h1>
diff --git a/context/team-context.tsx b/context/team-context.tsx
index b1d71dcb..fced0611 100644
--- a/context/team-context.tsx
+++ b/context/team-context.tsx
@@ -29,8 +29,8 @@ export const TeamProvider = ({ children }: TeamContextProps): JSX.Element => {
const currentTeamId = currentTeam
? currentTeam.id
: typeof localStorage !== "undefined"
- ? localStorage.getItem("currentTeamId")
- : null;
+ ? localStorage.getItem("currentTeamId")
+ : null;
const value = useMemo(
() => ({
@@ -41,7 +41,7 @@ export const TeamProvider = ({ children }: TeamContextProps): JSX.Element => {
isLoading: loading,
setCurrentTeam,
}),
- [teams, currentTeam, loading]
+ [teams, currentTeam, loading],
);
return <TeamContext.Provider value={value}>{children}</TeamContext.Provider>;
diff --git a/lib/analytics/index.ts b/lib/analytics/index.ts
index ca1c84c5..b79edcf2 100644
--- a/lib/analytics/index.ts
+++ b/lib/analytics/index.ts
@@ -30,8 +30,8 @@ const fetchUserWithCounts = async (userId: string) => {
views: true,
},
},
- }
- }
+ },
+ },
},
});
};
@@ -40,13 +40,13 @@ const getUserProperties = (user: any) => {
let linkCount = user.documents.reduce(
(acc: any, document: { _count: { links: number; views: number } }) =>
acc + document._count.links,
- 0
+ 0,
);
let viewCount = user.documents.reduce(
(acc: any, document: { _count: { links: number; views: number } }) =>
acc + document._count.views,
- 0
+ 0,
);
const userData = {
diff --git a/lib/api/domains.ts b/lib/api/domains.ts
index e5784691..f8799ea2 100644
--- a/lib/api/domains.ts
+++ b/lib/api/domains.ts
@@ -28,7 +28,7 @@ export async function deleteDomain(
{
// Note: in certain cases, we don't need to remove the domain from the Prisma
skipPrismaDelete = false,
- } = {}
+ } = {},
) {
const domainCount = await getDomainCount(domain);
diff --git a/lib/constants.ts b/lib/constants.ts
index 7bf3564a..9d757293 100644
--- a/lib/constants.ts
+++ b/lib/constants.ts
@@ -12,6 +12,7 @@ export const STAGGER_CHILD_VARIANTS = {
export const PAPERMARK_HEADERS = {
headers: {
- "x-powered-by": "Papermark.io - Document sharing infrastructure for the modern web",
+ "x-powered-by":
+ "Papermark.io - Document sharing infrastructure for the modern web",
},
-};
\ No newline at end of file
+};
diff --git a/lib/domains.ts b/lib/domains.ts
index c6de37b0..a7554764 100644
--- a/lib/domains.ts
+++ b/lib/domains.ts
@@ -4,8 +4,6 @@ import {
DomainVerificationResponse,
} from "@/lib/types";
-
-
export const addDomainToVercel = async (domain: string) => {
return await fetch(
`https://api.vercel.com/v9/projects/${process.env.PROJECT_ID_VERCEL}/domains?teamId=${process.env.TEAM_ID_VERCEL}`,
@@ -16,7 +14,7 @@ export const addDomainToVercel = async (domain: string) => {
"Content-Type": "application/json",
},
method: "POST",
- }
+ },
).then((res) => res.json());
};
@@ -28,7 +26,7 @@ export const removeDomainFromVercelProject = async (domain: string) => {
Authorization: `Bearer ${process.env.AUTH_BEARER_TOKEN}`,
},
method: "DELETE",
- }
+ },
).then((res) => res.json());
};
@@ -40,11 +38,14 @@ export const removeDomainFromVercelTeam = async (domain: string) => {
Authorization: `Bearer ${process.env.AUTH_BEARER_TOKEN}`,
},
method: "DELETE",
- }
+ },
).then((res) => res.json());
};
-export const removeDomainFromVercel = async (domain: string, domainCount: number) => {
+export const removeDomainFromVercel = async (
+ domain: string,
+ domainCount: number,
+) => {
if (domainCount > 1) {
// the apex domain is being used by other domains
// so we should only remove it from our Vercel project
@@ -58,7 +59,7 @@ export const removeDomainFromVercel = async (domain: string, domainCount: number
};
export const getDomainResponse = async (
- domain: string
+ domain: string,
): Promise<DomainResponse & { error: { code: string; message: string } }> => {
return await fetch(
`https://api.vercel.com/v9/projects/${process.env.PROJECT_ID_VERCEL}/domains/${domain}?teamId=${process.env.TEAM_ID_VERCEL}`,
@@ -68,14 +69,14 @@ export const getDomainResponse = async (
Authorization: `Bearer ${process.env.AUTH_BEARER_TOKEN}`,
"Content-Type": "application/json",
},
- }
+ },
).then((res) => {
return res.json();
});
};
export const getConfigResponse = async (
- domain: string
+ domain: string,
): Promise<DomainConfigResponse> => {
return await fetch(
`https://api.vercel.com/v6/domains/${domain}/config?teamId=${process.env.TEAM_ID_VERCEL}`,
@@ -85,12 +86,12 @@ export const getConfigResponse = async (
Authorization: `Bearer ${process.env.AUTH_BEARER_TOKEN}`,
"Content-Type": "application/json",
},
- }
+ },
).then((res) => res.json());
};
export const verifyDomain = async (
- domain: string
+ domain: string,
): Promise<DomainVerificationResponse> => {
return await fetch(
`https://api.vercel.com/v9/projects/${process.env.PROJECT_ID_VERCEL}/domains/${domain}/verify?teamId=${process.env.TEAM_ID_VERCEL}`,
@@ -100,7 +101,7 @@ export const verifyDomain = async (
Authorization: `Bearer ${process.env.AUTH_BEARER_TOKEN}`,
"Content-Type": "application/json",
},
- }
+ },
).then((res) => res.json());
};
@@ -127,5 +128,5 @@ export const getApexDomain = (url: string) => {
// courtesy of ChatGPT: https://sharegpt.com/c/pUYXtRs
export const validDomainRegex = new RegExp(
- /^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/
-);
\ No newline at end of file
+ /^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,
+);
diff --git a/lib/emails/send-invalid-domain.ts b/lib/emails/send-invalid-domain.ts
index a3b705fd..e4ca995c 100644
--- a/lib/emails/send-invalid-domain.ts
+++ b/lib/emails/send-invalid-domain.ts
@@ -1,7 +1,11 @@
import { sendEmail } from "@/lib/resend";
import InvalidDomainEmail from "@/components/emails/invalid-domain";
-export const sendInvalidDomainEmail = async (email: string, domain: string, invalidDays: number) => {
+export const sendInvalidDomainEmail = async (
+ email: string,
+ domain: string,
+ invalidDays: number,
+) => {
const emailTemplate = InvalidDomainEmail({ domain, invalidDays });
await sendEmail({
to: email,
diff --git a/lib/emails/send-trial-end-final-reminder.ts b/lib/emails/send-trial-end-final-reminder.ts
index 72355c91..85d5fa72 100644
--- a/lib/emails/send-trial-end-final-reminder.ts
+++ b/lib/emails/send-trial-end-final-reminder.ts
@@ -1,7 +1,10 @@
import { sendEmail } from "@/lib/resend";
import TrialEndFinalReminderEmail from "@/components/emails/trial-end-final-reminder";
-export const sendTrialEndFinalReminderEmail = async (email: string, name: string | null) => {
+export const sendTrialEndFinalReminderEmail = async (
+ email: string,
+ name: string | null,
+) => {
const emailTemplate = TrialEndFinalReminderEmail({ name });
await sendEmail({
to: email,
diff --git a/lib/emails/send-trial-end-reminder.ts b/lib/emails/send-trial-end-reminder.ts
index 29dbf376..7aa37707 100644
--- a/lib/emails/send-trial-end-reminder.ts
+++ b/lib/emails/send-trial-end-reminder.ts
@@ -1,7 +1,10 @@
import { sendEmail } from "@/lib/resend";
import TrialEndReminderEmail from "@/components/emails/trial-end-reminder";
-export const sendTrialEndReminderEmail = async (email: string, name: string | null) => {
+export const sendTrialEndReminderEmail = async (
+ email: string,
+ name: string | null,
+) => {
const emailTemplate = TrialEndReminderEmail({ name });
await sendEmail({
to: email,
diff --git a/lib/emails/send-viewed-document.ts b/lib/emails/send-viewed-document.ts
index 0f20e0a2..3d836c17 100644
--- a/lib/emails/send-viewed-document.ts
+++ b/lib/emails/send-viewed-document.ts
@@ -4,10 +4,14 @@ import ViewedDocumentEmail from "@/components/emails/viewed-document";
export const sendViewedDocumentEmail = async (
email: string,
documentId: string,
- documentName : string,
+ documentName: string,
viewerEmail: string | null,
) => {
- const emailTemplate = ViewedDocumentEmail({ documentId, documentName, viewerEmail });
+ const emailTemplate = ViewedDocumentEmail({
+ documentId,
+ documentName,
+ viewerEmail,
+ });
await sendEmail({
to: email,
subject: `Your document has been viewed: ${documentName}`,
diff --git a/lib/emails/send-welcome.ts b/lib/emails/send-welcome.ts
index 2927bccf..7cba4474 100644
--- a/lib/emails/send-welcome.ts
+++ b/lib/emails/send-welcome.ts
@@ -2,7 +2,6 @@ import { sendEmail } from "@/lib/resend";
import WelcomeEmail from "@/components/emails/welcome";
import { CreateUserEmailProps } from "../types";
-
export const sendWelcomeEmail = async (params: CreateUserEmailProps) => {
const { name, email } = params.user;
const emailTemplate = WelcomeEmail({ name });
@@ -12,4 +11,4 @@ export const sendWelcomeEmail = async (params: CreateUserEmailProps) => {
react: emailTemplate,
test: process.env.NODE_ENV === "development",
});
-};
\ No newline at end of file
+};
diff --git a/lib/middleware/app.ts b/lib/middleware/app.ts
index 3b757a8d..43072978 100644
--- a/lib/middleware/app.ts
+++ b/lib/middleware/app.ts
@@ -18,8 +18,8 @@ export default async function AppMiddleware(req: NextRequest) {
return NextResponse.redirect(
new URL(
`/login${path !== "/" ? `?next=${encodeURIComponent(path)}` : ""}`,
- req.url
- )
+ req.url,
+ ),
);
// if there's a token
diff --git a/lib/middleware/domain.ts b/lib/middleware/domain.ts
index ef28fd79..0f4bc887 100644
--- a/lib/middleware/domain.ts
+++ b/lib/middleware/domain.ts
@@ -5,11 +5,10 @@ import { PAPERMARK_HEADERS } from "../constants";
export default async function DomainMiddleware(req: NextRequest) {
const path = req.nextUrl.pathname;
const host = req.headers.get("host");
-
// clone the URL so we can modify it
const url = req.nextUrl.clone();
-
+
// if there's a path and it's not "/" then we need to check if it's a custom domain
if (path !== "/") {
// Subdomain available, rewriting
diff --git a/lib/resend.ts b/lib/resend.ts
index bb73f9b5..61c1e826 100644
--- a/lib/resend.ts
+++ b/lib/resend.ts
@@ -23,14 +23,16 @@ export const sendEmail = async ({
}) => {
if (!resend) {
console.log(
- "Resend is not configured. You need to add a RESEND_API_KEY in your .env file for emails to work."
+ "Resend is not configured. You need to add a RESEND_API_KEY in your .env file for emails to work.",
);
return Promise.resolve();
}
return resend.emails.send({
from: marketing
? "Marc from Papermark <[email protected]>"
- : system ? "Papermark <[email protected]>" : "Marc from Papermark <[email protected]>",
+ : system
+ ? "Papermark <[email protected]>"
+ : "Marc from Papermark <[email protected]>",
to: test ? "[email protected]" : to,
reply_to: marketing ? "[email protected]" : undefined,
subject,
@@ -39,4 +41,4 @@ export const sendEmail = async ({
"X-Entity-Ref-ID": nanoid(),
},
});
-};
\ No newline at end of file
+};
diff --git a/lib/stripe/client.ts b/lib/stripe/client.ts
index 6a0000a6..5bb9d701 100644
--- a/lib/stripe/client.ts
+++ b/lib/stripe/client.ts
@@ -8,7 +8,7 @@ export const getStripe = () => {
stripePromise = loadStripe(
process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY_LIVE ??
process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY ??
- ""
+ "",
);
}
diff --git a/lib/stripe/index.ts b/lib/stripe/index.ts
index 3ded5b77..afa14f96 100644
--- a/lib/stripe/index.ts
+++ b/lib/stripe/index.ts
@@ -8,10 +8,9 @@ export const stripe = new Stripe(
name: "Papermark.io",
version: "0.1.0",
},
- }
+ },
);
-
export async function cancelSubscription(customer?: string) {
if (!customer) return;
diff --git a/lib/stripe/utils.ts b/lib/stripe/utils.ts
index 7d549ab4..7280e54a 100644
--- a/lib/stripe/utils.ts
+++ b/lib/stripe/utils.ts
@@ -6,14 +6,14 @@ export function getPlanFromPriceId(priceId: string) {
return PLANS.find(
(plan) =>
plan.price.monthly.priceIds[env] === priceId ||
- plan.price.yearly.priceIds[env] === priceId
+ plan.price.yearly.priceIds[env] === priceId,
)!;
}
// custom type coercion because Stripe's types are wrong
export function isNewCustomer(
previousAttributes: // Stripe.Event.Data.PreviousAttributes | undefined
- | {
+ | {
default_payment_method?: string;
items?: {
data?: {
@@ -23,7 +23,7 @@ export function isNewCustomer(
};
};
}
- | undefined
+ | undefined,
) {
let isNewCustomer = false;
try {
@@ -32,7 +32,7 @@ export function isNewCustomer(
previousAttributes?.default_payment_method === null
) {
isNewCustomer = true;
- }
+ }
} catch (error) {
console.error("An error occurred:", error);
}
diff --git a/lib/swr/use-billing.ts b/lib/swr/use-billing.ts
index 420d6f13..5e8e5e0d 100644
--- a/lib/swr/use-billing.ts
+++ b/lib/swr/use-billing.ts
@@ -23,7 +23,7 @@ export function useBilling() {
fetcher,
{
dedupingInterval: 30000,
- }
+ },
);
return {
@@ -45,7 +45,7 @@ export function usePlan() {
fetcher,
{
dedupingInterval: 60000,
- }
+ },
);
return {
diff --git a/lib/swr/use-document.ts b/lib/swr/use-document.ts
index bfe9c088..de1cb9e0 100644
--- a/lib/swr/use-document.ts
+++ b/lib/swr/use-document.ts
@@ -16,12 +16,12 @@ export function useDocument() {
const { data: document, error } = useSWR<DocumentWithVersion>(
id &&
`/api/teams/${teamInfo?.currentTeam?.id}/documents/${encodeURIComponent(
- id
+ id,
)}`,
fetcher,
{
dedupingInterval: 10000,
- }
+ },
);
return {
@@ -43,12 +43,12 @@ export function useDocumentLinks() {
const { data: links, error } = useSWR<LinkWithViews[]>(
id &&
`/api/teams/${teamInfo?.currentTeam?.id}/documents/${encodeURIComponent(
- id
+ id,
)}/links`,
fetcher,
{
dedupingInterval: 10000,
- }
+ },
);
return {
@@ -80,12 +80,12 @@ export function useDocumentVisits() {
const { data: views, error } = useSWR<ViewWithDuration[]>(
id &&
`/api/teams/${teamInfo?.currentTeam?.id}/documents/${encodeURIComponent(
- id
+ id,
)}/views`,
fetcher,
{
dedupingInterval: 10000,
- }
+ },
);
return {
@@ -109,7 +109,7 @@ export function useDocumentProcessingStatus(documentVersionId: string) {
fetcher,
{
refreshInterval: 3000, // refresh every 3 seconds
- }
+ },
);
return {
@@ -117,4 +117,4 @@ export function useDocumentProcessingStatus(documentVersionId: string) {
loading: !error && !status,
error: error,
};
-}
\ No newline at end of file
+}
diff --git a/lib/swr/use-documents.ts b/lib/swr/use-documents.ts
index 1a7cce47..dc9ee27b 100644
--- a/lib/swr/use-documents.ts
+++ b/lib/swr/use-documents.ts
@@ -16,7 +16,7 @@ export default function useDocuments() {
{
revalidateOnFocus: false,
dedupingInterval: 30000,
- }
+ },
);
return {
diff --git a/lib/swr/use-domains.ts b/lib/swr/use-domains.ts
index 625f559a..7ac0790f 100644
--- a/lib/swr/use-domains.ts
+++ b/lib/swr/use-domains.ts
@@ -11,7 +11,7 @@ export function useDomains() {
fetcher,
{
dedupingInterval: 60000,
- }
+ },
);
return {
diff --git a/lib/swr/use-stats.ts b/lib/swr/use-stats.ts
index 6883ad89..3d812904 100644
--- a/lib/swr/use-stats.ts
+++ b/lib/swr/use-stats.ts
@@ -13,7 +13,7 @@ interface StatsData {
views: View[];
groupedViews: GroupedView[];
duration: {
- data: { versionNumber: number, pageNumber: string; avg_duration: number }[];
+ data: { versionNumber: number; pageNumber: string; avg_duration: number }[];
};
total_duration: number;
}
@@ -30,12 +30,12 @@ export function useStats() {
const { data: stats, error } = useSWR<StatsData>(
id &&
`/api/teams/${teamInfo?.currentTeam?.id}/documents/${encodeURIComponent(
- id
+ id,
)}/stats`,
fetcher,
{
dedupingInterval: 10000,
- }
+ },
);
return {
@@ -65,12 +65,12 @@ export function useVisitorStats(viewId: string) {
documentId &&
viewId &&
`/api/teams/${teamInfo?.currentTeam?.id}/documents/${encodeURIComponent(
- documentId
+ documentId,
)}/views/${encodeURIComponent(viewId)}/stats`,
fetcher,
{
dedupingInterval: 10000,
- }
+ },
);
return {
diff --git a/lib/swr/use-teams.ts b/lib/swr/use-teams.ts
index f77576c8..100a985c 100644
--- a/lib/swr/use-teams.ts
+++ b/lib/swr/use-teams.ts
@@ -11,7 +11,7 @@ export function useTeams() {
fetcher,
{
dedupingInterval: 20000,
- }
+ },
);
return {
diff --git a/lib/team/helper.ts b/lib/team/helper.ts
index f0251ca9..63698732 100644
--- a/lib/team/helper.ts
+++ b/lib/team/helper.ts
@@ -59,7 +59,11 @@ export async function getTeamWithUsersAndDocument({
// check if the document exists in the team
let document:
- | (Document & { views?: View[]; versions?: DocumentVersion[]; links?: Link[] })
+ | (Document & {
+ views?: View[];
+ versions?: DocumentVersion[];
+ links?: Link[];
+ })
| undefined;
if (docId) {
document = team.documents.find((doc) => doc.id === docId);
@@ -143,7 +147,7 @@ export async function getDocumentWithTeamAndUser({
}
const teamHasUser = document.team?.users.some(
- (user) => user.userId === userId
+ (user) => user.userId === userId,
);
if (!teamHasUser) {
throw new TeamError("You are not a member of the team");
diff --git a/lib/tinybird/pipes.ts b/lib/tinybird/pipes.ts
index 710f306e..111d4555 100644
--- a/lib/tinybird/pipes.ts
+++ b/lib/tinybird/pipes.ts
@@ -28,4 +28,4 @@ export const getViewPageDuration = tb.buildPipe({
pageNumber: z.string(),
sum_duration: z.number(),
}),
-});
\ No newline at end of file
+});
diff --git a/lib/utils.ts b/lib/utils.ts
index 7fc1ca9d..1b296c5a 100644
--- a/lib/utils.ts
+++ b/lib/utils.ts
@@ -1,6 +1,6 @@
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
-import ms from "ms"
+import ms from "ms";
import bcrypt from "bcryptjs";
import { toast } from "sonner";
import { customAlphabet } from "nanoid";
@@ -25,7 +25,7 @@ interface SWRError extends Error {
export async function fetcher<JSON = any>(
input: RequestInfo,
- init?: RequestInit
+ init?: RequestInit,
): Promise<JSON> {
const res = await fetch(input, init);
@@ -76,7 +76,6 @@ export function bytesToSize(bytes: number) {
return `${Math.round(sizeInCurrentUnit)} ${sizes[i]}`;
}
-
const isValidUrl = (url: string) => {
try {
new URL(url);
@@ -104,7 +103,6 @@ export function capitalize(str: string) {
return str.charAt(0).toUpperCase() + str.slice(1);
}
-
export const timeAgo = (timestamp?: Date): string => {
if (!timestamp) return "Just now";
const diff = Date.now() - new Date(timestamp).getTime();
@@ -170,7 +168,6 @@ export const getDateTimeLocal = (timestamp?: Date): string => {
.join(":");
};
-
export async function hashPassword(password: string): Promise<string> {
const saltRounds = 10;
const hashedPassword = await bcrypt.hash(password, saltRounds);
@@ -179,7 +176,7 @@ export async function hashPassword(password: string): Promise<string> {
export async function checkPassword(
password: string,
- hashedPassword: string
+ hashedPassword: string,
): Promise<boolean> {
const match = await bcrypt.compare(password, hashedPassword);
return match;
@@ -192,7 +189,7 @@ export function copyToClipboard(text: string, message: string): void {
toast.success(message);
})
.catch((error) => {
- toast.warning("Please copy your link manually.")
+ toast.warning("Please copy your link manually.");
});
}
@@ -224,15 +221,17 @@ export const formattedDate = (date: Date) => {
day: "2-digit",
year: "numeric",
});
-}
+};
export const nanoid = customAlphabet(
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
7,
); // 7-character random string
-
-export const daysLeft = (accountCreationDate: Date, maxDays: number): number => {
+export const daysLeft = (
+ accountCreationDate: Date,
+ maxDays: number,
+): number => {
const now = new Date();
const endPeriodDate = new Date(accountCreationDate);
endPeriodDate.setDate(accountCreationDate.getDate() + maxDays);
@@ -241,7 +240,7 @@ export const daysLeft = (accountCreationDate: Date, maxDays: number): number =>
// Convert milliseconds to days and return
return Math.ceil(diffInMilliseconds / (1000 * 60 * 60 * 24));
-}
+};
const cutoffDate = new Date("2023-10-17T00:00:00.000Z");
@@ -254,4 +253,4 @@ export const calculateDaysLeft = (accountCreationDate: Date): number => {
maxDays = 14;
}
return daysLeft(accountCreationDate, maxDays);
-};
\ No newline at end of file
+};
diff --git a/lib/utils/geo.ts b/lib/utils/geo.ts
index dd98f470..982680a2 100644
--- a/lib/utils/geo.ts
+++ b/lib/utils/geo.ts
@@ -20,8 +20,7 @@ export function getGeoData(headers: {
? headers["x-vercel-ip-longitude"][0]
: headers["x-vercel-ip-longitude"],
};
-}
-
+}
export const LOCALHOST_GEO_DATA = {
city: "Munich",
diff --git a/lib/utils/user-agent.ts b/lib/utils/user-agent.ts
index a46be41d..9609673d 100644
--- a/lib/utils/user-agent.ts
+++ b/lib/utils/user-agent.ts
@@ -1,9 +1,8 @@
import { UAParser } from "ua-parser-js";
-
function isBot(input: string) {
return /Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(
- input
+ input,
);
}
@@ -14,8 +13,6 @@ export function userAgentFromString(input: string | undefined): UserAgent {
};
}
-
-
interface UserAgent {
isBot: boolean;
ua: string;
@@ -39,4 +36,4 @@ interface UserAgent {
cpu: {
architecture?: string;
};
-}
\ No newline at end of file
+}
diff --git a/pages/_app.tsx b/pages/_app.tsx
index 70cff992..9d8f98a7 100644
--- a/pages/_app.tsx
+++ b/pages/_app.tsx
@@ -25,7 +25,8 @@ export default function App({
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
<PlausibleProvider
domain="papermark.io"
- enabled={process.env.NEXT_PUBLIC_VERCEL_ENV === "production"}>
+ enabled={process.env.NEXT_PUBLIC_VERCEL_ENV === "production"}
+ >
<main className={inter.className}>
<Toaster closeButton richColors theme={"system"} />
<TeamProvider>
diff --git a/pages/_document.tsx b/pages/_document.tsx
index af8eb05b..bf9e456b 100644
--- a/pages/_document.tsx
+++ b/pages/_document.tsx
@@ -9,7 +9,10 @@ export default function Document() {
name="description"
content="Papermark is an open-source document sharing alternative to DocSend with built-in analytics."
/>
- <meta property="og:title" content="Papermark | The Open Source DocSend Alternative" />
+ <meta
+ property="og:title"
+ content="Papermark | The Open Source DocSend Alternative"
+ />
<meta
property="og:description"
content="Papermark is an open-source document sharing alternative to DocSend with built-in analytics."
diff --git a/pages/alternatives/brieflink.tsx b/pages/alternatives/brieflink.tsx
index 32afbd3e..64dd6469 100644
--- a/pages/alternatives/brieflink.tsx
+++ b/pages/alternatives/brieflink.tsx
@@ -1,6 +1,5 @@
import Head from "next/head";
import Footer from "@/components/web/footer";
-import Logos from "@/components/web/logos";
import { Disclosure } from "@headlessui/react";
import { MinusSmallIcon, PlusSmallIcon } from "@heroicons/react/24/outline";
import {
@@ -230,9 +229,9 @@ export default function Home() {
tier.featured
? ""
: tierIdx === 0
- ? "text-gray-800 dark:text-white rounded-t-3xl lg:rounded-bl-3xl"
- : "bg-black dark:bg-transparent sm:rounded-t-none lg:rounded-tr-3xl lg:rounded-bl-none",
- "rounded-3xl p-8 ring-1 ring-gray-900/10 dark:ring-gray-200/10 sm:p-10"
+ ? "text-gray-800 dark:text-white rounded-t-3xl lg:rounded-bl-3xl"
+ : "bg-black dark:bg-transparent sm:rounded-t-none lg:rounded-tr-3xl lg:rounded-bl-none",
+ "rounded-3xl p-8 ring-1 ring-gray-900/10 dark:ring-gray-200/10 sm:p-10",
)}
>
<p className="mt-4 flex items-baseline gap-x-2">
@@ -241,7 +240,7 @@ export default function Home() {
tier.featured
? "text-gray-800 dark:text-white"
: "text-gray-800 dark:text-gray-400",
- "text-5xl font-bold tracking-tight"
+ "text-5xl font-bold tracking-tight",
)}
>
{tier.priceMonthly}
@@ -251,7 +250,7 @@ export default function Home() {
tier.featured
? "text-gray-600 dark:text-white"
: "text-gray-400 dark:text-gray-100",
- "text-base"
+ "text-base",
)}
></span>
</p>
@@ -260,7 +259,7 @@ export default function Home() {
tier.featured
? "text-gray-600 dark:text-gray-300"
: "text-gray-600 dark:text-gray-400",
- "mt-6 text-base leading-7"
+ "mt-6 text-base leading-7",
)}
>
{tier.description}
@@ -271,7 +270,7 @@ export default function Home() {
tier.featured
? "text-gray-600 dark:text-gray-300"
: "text-gray-600 dark:text-gray-400",
- "mt-8 space-y-3 text-sm leading-6 sm:mt-10"
+ "mt-8 space-y-3 text-sm leading-6 sm:mt-10",
)}
>
{tier.features.map((feature) => (
@@ -287,7 +286,7 @@ export default function Home() {
tier.featured
? "bg-black dark:bg-white text-white dark:text-black shadow-sm hover:bg-gray-500 focus:ring-2 focus:ring-indigo-500"
: "text-transparent ring-1 ring-inset ring-transparent focus:ring-2 focus:ring-indigo-600",
- "mt-8 block rounded-md py-2.5 px-3.5 text-center text-sm font-semibold"
+ "mt-8 block rounded-md py-2.5 px-3.5 text-center text-sm font-semibold",
)}
>
Send Document
diff --git a/pages/alternatives/docsend.tsx b/pages/alternatives/docsend.tsx
index aea090af..e65755e1 100644
--- a/pages/alternatives/docsend.tsx
+++ b/pages/alternatives/docsend.tsx
@@ -1,6 +1,5 @@
import Head from "next/head";
import Footer from "@/components/web/footer";
-import Logos from "@/components/web/logos";
import { Disclosure } from "@headlessui/react";
import { MinusSmallIcon, PlusSmallIcon } from "@heroicons/react/24/outline";
import {
@@ -230,9 +229,9 @@ export default function Home() {
tier.featured
? ""
: tierIdx === 0
- ? "text-gray-800 dark:text-white rounded-t-3xl lg:rounded-bl-3xl"
- : "bg-black dark:bg-transparent sm:rounded-t-none lg:rounded-tr-3xl lg:rounded-bl-none",
- "rounded-3xl p-8 ring-1 ring-gray-900/10 dark:ring-gray-200/10 sm:p-10"
+ ? "text-gray-800 dark:text-white rounded-t-3xl lg:rounded-bl-3xl"
+ : "bg-black dark:bg-transparent sm:rounded-t-none lg:rounded-tr-3xl lg:rounded-bl-none",
+ "rounded-3xl p-8 ring-1 ring-gray-900/10 dark:ring-gray-200/10 sm:p-10",
)}
>
<p className="mt-4 flex items-baseline gap-x-2">
@@ -241,7 +240,7 @@ export default function Home() {
tier.featured
? "text-gray-800 dark:text-white"
: "text-gray-800 dark:text-gray-400",
- "text-5xl font-bold tracking-tight"
+ "text-5xl font-bold tracking-tight",
)}
>
{tier.priceMonthly}
@@ -251,7 +250,7 @@ export default function Home() {
tier.featured
? "text-gray-600 dark:text-white"
: "text-gray-400 dark:text-gray-100",
- "text-base"
+ "text-base",
)}
></span>
</p>
@@ -260,7 +259,7 @@ export default function Home() {
tier.featured
? "text-gray-600 dark:text-gray-300"
: "text-gray-600 dark:text-gray-400",
- "mt-6 text-base leading-7"
+ "mt-6 text-base leading-7",
)}
>
{tier.description}
@@ -271,7 +270,7 @@ export default function Home() {
tier.featured
? "text-gray-600 dark:text-gray-300"
: "text-gray-600 dark:text-gray-400",
- "mt-8 space-y-3 text-sm leading-6 sm:mt-10"
+ "mt-8 space-y-3 text-sm leading-6 sm:mt-10",
)}
>
{tier.features.map((feature) => (
@@ -287,7 +286,7 @@ export default function Home() {
tier.featured
? "bg-black dark:bg-white text-white dark:text-black shadow-sm hover:bg-gray-500 focus:ring-2 focus:ring-indigo-500"
: "text-transparent ring-1 ring-inset ring-transparent focus:ring-2 focus:ring-indigo-600",
- "mt-8 block rounded-md py-2.5 px-3.5 text-center text-sm font-semibold"
+ "mt-8 block rounded-md py-2.5 px-3.5 text-center text-sm font-semibold",
)}
>
Send Document
diff --git a/pages/alternatives/google-drive.tsx b/pages/alternatives/google-drive.tsx
index ca7dca26..80e28dec 100644
--- a/pages/alternatives/google-drive.tsx
+++ b/pages/alternatives/google-drive.tsx
@@ -1,6 +1,5 @@
import Head from "next/head";
import Footer from "@/components/web/footer";
-import Logos from "@/components/web/logos";
import { Disclosure } from "@headlessui/react";
import { MinusSmallIcon, PlusSmallIcon } from "@heroicons/react/24/outline";
import {
@@ -233,9 +232,9 @@ export default function Home() {
tier.featured
? ""
: tierIdx === 0
- ? "text-gray-800 dark:text-white rounded-t-3xl lg:rounded-bl-3xl"
- : "bg-black dark:bg-transparent sm:rounded-t-none lg:rounded-tr-3xl lg:rounded-bl-none",
- "rounded-3xl p-8 ring-1 ring-gray-900/10 dark:ring-gray-200/10 sm:p-10"
+ ? "text-gray-800 dark:text-white rounded-t-3xl lg:rounded-bl-3xl"
+ : "bg-black dark:bg-transparent sm:rounded-t-none lg:rounded-tr-3xl lg:rounded-bl-none",
+ "rounded-3xl p-8 ring-1 ring-gray-900/10 dark:ring-gray-200/10 sm:p-10",
)}
>
<p className="mt-4 flex items-baseline gap-x-2">
@@ -244,7 +243,7 @@ export default function Home() {
tier.featured
? "text-gray-800 dark:text-white"
: "text-gray-800 dark:text-gray-400",
- "text-5xl font-bold tracking-tight"
+ "text-5xl font-bold tracking-tight",
)}
>
{tier.priceMonthly}
@@ -254,7 +253,7 @@ export default function Home() {
tier.featured
? "text-gray-600 dark:text-white"
: "text-gray-400 dark:text-gray-100",
- "text-base"
+ "text-base",
)}
></span>
</p>
@@ -263,7 +262,7 @@ export default function Home() {
tier.featured
? "text-gray-600 dark:text-gray-300"
: "text-gray-600 dark:text-gray-400",
- "mt-6 text-base leading-7"
+ "mt-6 text-base leading-7",
)}
>
{tier.description}
@@ -274,7 +273,7 @@ export default function Home() {
tier.featured
? "text-gray-600 dark:text-gray-300"
: "text-gray-600 dark:text-gray-400",
- "mt-8 space-y-3 text-sm leading-6 sm:mt-10"
+ "mt-8 space-y-3 text-sm leading-6 sm:mt-10",
)}
>
{tier.features.map((feature) => (
@@ -290,7 +289,7 @@ export default function Home() {
tier.featured
? "bg-black dark:bg-white text-white dark:text-black shadow-sm hover:bg-gray-500 focus:ring-2 focus:ring-indigo-500"
: "text-transparent ring-1 ring-inset ring-transparent focus:ring-2 focus:ring-indigo-600",
- "mt-8 block rounded-md py-2.5 px-3.5 text-center text-sm font-semibold"
+ "mt-8 block rounded-md py-2.5 px-3.5 text-center text-sm font-semibold",
)}
>
Send Document
diff --git a/pages/alternatives/pandadoc.tsx b/pages/alternatives/pandadoc.tsx
index 202760d9..0eb22612 100644
--- a/pages/alternatives/pandadoc.tsx
+++ b/pages/alternatives/pandadoc.tsx
@@ -1,6 +1,5 @@
import Head from "next/head";
import Footer from "@/components/web/footer";
-import Logos from "@/components/web/logos";
import { Disclosure } from "@headlessui/react";
import { MinusSmallIcon, PlusSmallIcon } from "@heroicons/react/24/outline";
import {
@@ -231,9 +230,9 @@ export default function Home() {
tier.featured
? ""
: tierIdx === 0
- ? "text-gray-800 dark:text-white rounded-t-3xl lg:rounded-bl-3xl"
- : "bg-black dark:bg-transparent sm:rounded-t-none lg:rounded-tr-3xl lg:rounded-bl-none",
- "rounded-3xl p-8 ring-1 ring-gray-900/10 dark:ring-gray-200/10 sm:p-10"
+ ? "text-gray-800 dark:text-white rounded-t-3xl lg:rounded-bl-3xl"
+ : "bg-black dark:bg-transparent sm:rounded-t-none lg:rounded-tr-3xl lg:rounded-bl-none",
+ "rounded-3xl p-8 ring-1 ring-gray-900/10 dark:ring-gray-200/10 sm:p-10",
)}
>
<p className="mt-4 flex items-baseline gap-x-2">
@@ -242,7 +241,7 @@ export default function Home() {
tier.featured
? "text-gray-800 dark:text-white"
: "text-gray-800 dark:text-gray-400",
- "text-5xl font-bold tracking-tight"
+ "text-5xl font-bold tracking-tight",
)}
>
{tier.priceMonthly}
@@ -252,7 +251,7 @@ export default function Home() {
tier.featured
? "text-gray-600 dark:text-white"
: "text-gray-400 dark:text-gray-100",
- "text-base"
+ "text-base",
)}
></span>
</p>
@@ -261,7 +260,7 @@ export default function Home() {
tier.featured
? "text-gray-600 dark:text-gray-300"
: "text-gray-600 dark:text-gray-400",
- "mt-6 text-base leading-7"
+ "mt-6 text-base leading-7",
)}
>
{tier.description}
@@ -272,7 +271,7 @@ export default function Home() {
tier.featured
? "text-gray-600 dark:text-gray-300"
: "text-gray-600 dark:text-gray-400",
- "mt-8 space-y-3 text-sm leading-6 sm:mt-10"
+ "mt-8 space-y-3 text-sm leading-6 sm:mt-10",
)}
>
{tier.features.map((feature) => (
@@ -288,7 +287,7 @@ export default function Home() {
tier.featured
? "bg-black dark:bg-white text-white dark:text-black shadow-sm hover:bg-gray-500 focus:ring-2 focus:ring-indigo-500"
: "text-transparent ring-1 ring-inset ring-transparent focus:ring-2 focus:ring-indigo-600",
- "mt-8 block rounded-md py-2.5 px-3.5 text-center text-sm font-semibold"
+ "mt-8 block rounded-md py-2.5 px-3.5 text-center text-sm font-semibold",
)}
>
Send Document
diff --git a/pages/alternatives/pitch.tsx b/pages/alternatives/pitch.tsx
index 360de618..34f5ac4c 100644
--- a/pages/alternatives/pitch.tsx
+++ b/pages/alternatives/pitch.tsx
@@ -1,6 +1,5 @@
import Head from "next/head";
import Footer from "@/components/web/footer";
-import Logos from "@/components/web/logos";
import { Disclosure } from "@headlessui/react";
import { MinusSmallIcon, PlusSmallIcon } from "@heroicons/react/24/outline";
import {
@@ -230,9 +229,9 @@ export default function Home() {
tier.featured
? ""
: tierIdx === 0
- ? "text-gray-800 dark:text-white rounded-t-3xl lg:rounded-bl-3xl"
- : "bg-black dark:bg-transparent sm:rounded-t-none lg:rounded-tr-3xl lg:rounded-bl-none",
- "rounded-3xl p-8 ring-1 ring-gray-900/10 dark:ring-gray-200/10 sm:p-10"
+ ? "text-gray-800 dark:text-white rounded-t-3xl lg:rounded-bl-3xl"
+ : "bg-black dark:bg-transparent sm:rounded-t-none lg:rounded-tr-3xl lg:rounded-bl-none",
+ "rounded-3xl p-8 ring-1 ring-gray-900/10 dark:ring-gray-200/10 sm:p-10",
)}
>
<p className="mt-4 flex items-baseline gap-x-2">
@@ -241,7 +240,7 @@ export default function Home() {
tier.featured
? "text-gray-800 dark:text-white"
: "text-gray-800 dark:text-gray-400",
- "text-5xl font-bold tracking-tight"
+ "text-5xl font-bold tracking-tight",
)}
>
{tier.priceMonthly}
@@ -251,7 +250,7 @@ export default function Home() {
tier.featured
? "text-gray-600 dark:text-white"
: "text-gray-400 dark:text-gray-100",
- "text-base"
+ "text-base",
)}
></span>
</p>
@@ -260,7 +259,7 @@ export default function Home() {
tier.featured
? "text-gray-600 dark:text-gray-300"
: "text-gray-600 dark:text-gray-400",
- "mt-6 text-base leading-7"
+ "mt-6 text-base leading-7",
)}
>
{tier.description}
@@ -271,7 +270,7 @@ export default function Home() {
tier.featured
? "text-gray-600 dark:text-gray-300"
: "text-gray-600 dark:text-gray-400",
- "mt-8 space-y-3 text-sm leading-6 sm:mt-10"
+ "mt-8 space-y-3 text-sm leading-6 sm:mt-10",
)}
>
{tier.features.map((feature) => (
@@ -287,7 +286,7 @@ export default function Home() {
tier.featured
? "bg-black dark:bg-white text-white dark:text-black shadow-sm hover:bg-gray-500 focus:ring-2 focus:ring-indigo-500"
: "text-transparent ring-1 ring-inset ring-transparent focus:ring-2 focus:ring-indigo-600",
- "mt-8 block rounded-md py-2.5 px-3.5 text-center text-sm font-semibold"
+ "mt-8 block rounded-md py-2.5 px-3.5 text-center text-sm font-semibold",
)}
>
Send Document
diff --git a/pages/documents/[id].tsx b/pages/documents/[id].tsx
index 70b92e99..961e26c1 100644
--- a/pages/documents/[id].tsx
+++ b/pages/documents/[id].tsx
@@ -62,7 +62,7 @@ export default function DocumentPage() {
body: JSON.stringify({
name: newName,
}),
- }
+ },
);
if (response.ok) {
@@ -102,7 +102,7 @@ export default function DocumentPage() {
`/api/teams/${teamInfo?.currentTeam?.id}/documents/${documentId}`,
{
method: "DELETE",
- }
+ },
);
if (response.ok) {
@@ -145,7 +145,7 @@ export default function DocumentPage() {
};
const preventEnterAndSubmit = (
- event: React.KeyboardEvent<HTMLHeadingElement>
+ event: React.KeyboardEvent<HTMLHeadingElement>,
) => {
if (event.key === "Enter") {
event.preventDefault(); // Prevent the default line break
diff --git a/pages/documents/index.tsx b/pages/documents/index.tsx
index 1906a729..c97b20f2 100644
--- a/pages/documents/index.tsx
+++ b/pages/documents/index.tsx
@@ -1,15 +1,12 @@
-import Sidebar from "@/components/Sidebar";
import useDocuments from "@/lib/swr/use-documents";
import DocumentCard from "@/components/documents/document-card";
import Skeleton from "@/components/Skeleton";
import { PlusIcon } from "@heroicons/react/24/solid";
-import Link from "next/link";
import { AddDocumentModal } from "@/components/documents/add-document-modal";
import { Separator } from "@/components/ui/separator";
-import AppLayout from "@/components/layouts/app"
+import AppLayout from "@/components/layouts/app";
import { Button } from "@/components/ui/button";
-
export default function Documents() {
const { documents } = useDocuments();
@@ -21,7 +18,9 @@ export default function Documents() {
<h2 className="text-2xl text-foreground font-semibold tracking-tight">
Documents
</h2>
- <p className="text-sm text-muted-foreground">Manage your documents</p>
+ <p className="text-sm text-muted-foreground">
+ Manage your documents
+ </p>
</div>
<ul className="flex items-center justify-between gap-4">
<AddDocumentModal>
diff --git a/pages/privacy.tsx b/pages/privacy.tsx
index 6d3ed343..78321df8 100644
--- a/pages/privacy.tsx
+++ b/pages/privacy.tsx
@@ -15,8 +15,8 @@ export default function PrivacyPage() {
</p>
<p>
Papermark (“us”, “we”, or “our”) operates{" "}
- <a href="https://papermark.io">https://papermark.io</a>{" "}
- (hereinafter referred to as “<strong>Service</strong>”).
+ <a href="https://papermark.io">https://papermark.io</a> (hereinafter
+ referred to as “<strong>Service</strong>”).
</p>
<p>
Our Privacy Policy governs your visit to{" "}
@@ -236,12 +236,12 @@ export default function PrivacyPage() {
such information represents your agreement to that transfer.
</p>
<p>
- Papermark will take all the steps reasonably necessary to
- ensure that your data is treated securely and in accordance with
- this Privacy Policy and no transfer of your Personal Data will take
- place to an organisation or a country unless there are adequate
- controls in place including the security of your data and other
- personal information.
+ Papermark will take all the steps reasonably necessary to ensure
+ that your data is treated securely and in accordance with this
+ Privacy Policy and no transfer of your Personal Data will take place
+ to an organisation or a country unless there are adequate controls
+ in place including the security of your data and other personal
+ information.
</p>
<h3>8. Disclosure of Data</h3>
<p>
@@ -576,8 +576,8 @@ export default function PrivacyPage() {
<p>
Our Service may contain links to other sites that are not operated
by us. If you click a third party link, you will be directed to that
- third party&APOS;s site. We strongly advise you to review the Privacy
- Policy of every site you visit.
+ third party&APOS;s site. We strongly advise you to review the
+ Privacy Policy of every site you visit.
</p>
<p>
We have no control over and assume no responsibility for the
diff --git a/pages/settings/billing.tsx b/pages/settings/billing.tsx
index e5b4896b..a0492f1e 100644
--- a/pages/settings/billing.tsx
+++ b/pages/settings/billing.tsx
@@ -8,7 +8,7 @@ import { useBilling } from "@/lib/swr/use-billing";
import { cn, formattedDate, getFirstAndLastDay } from "@/lib/utils";
import Link from "next/link";
import { useRouter } from "next/router";
-import { useEffect, useMemo, useState } from "react";
+import { useEffect, useState } from "react";
import { toast } from "sonner";
interface Tier {
@@ -112,8 +112,9 @@ export default function Billing() {
`rounded-3xl p-8 sm:p-10 bg-white dark:bg-gray-800`,
tier.currentPlan || tier.isTrial
? "ring-2 ring-primary"
- : "ring-1 ring-gray-900/10 dark:ring-gray-200/10"
- )}>
+ : "ring-1 ring-gray-900/10 dark:ring-gray-200/10",
+ )}
+ >
<h2 className="text-xl font-bold mb-4 inline-flex items-center gap-x-2">
{tier.title}{" "}
{tier.currentPlan ? (
@@ -136,12 +137,14 @@ export default function Billing() {
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
- xmlns="http://www.w3.org/2000/svg">
+ xmlns="http://www.w3.org/2000/svg"
+ >
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
- d="M5 13l4 4L19 7"></path>
+ d="M5 13l4 4L19 7"
+ ></path>
</svg>
{feature}
</div>
@@ -158,7 +161,8 @@ export default function Billing() {
type="button"
variant="ghost"
className="border border-gray-700"
- disabled>
+ disabled
+ >
Change plan
</Button>
)
@@ -175,7 +179,7 @@ export default function Billing() {
`/api/teams/${teamInfo?.currentTeam?.id}/billing/manage`,
{
method: "POST",
- }
+ },
)
.then(async (res) => {
const url = await res.json();
@@ -186,7 +190,8 @@ export default function Billing() {
setClicked(false);
});
}}
- loading={clicked}>
+ loading={clicked}
+ >
Manage Subscription
</Button>
) : (
@@ -202,13 +207,15 @@ export default function Billing() {
<div className="h-10 w-24 animate-pulse rounded-md bg-border" />
))}
{tier.id === 3 && (
- <Link href="https://cal.com/marcseitz/papermark" target="_blank">
+ <Link
+ href="https://cal.com/marcseitz/papermark"
+ target="_blank"
+ >
<Button
type="button"
variant="ghost"
className="border border-gray-700"
>
-
Contact us
</Button>
</Link>
diff --git a/pages/settings/domains.tsx b/pages/settings/domains.tsx
index d338a49f..36b19fcd 100644
--- a/pages/settings/domains.tsx
+++ b/pages/settings/domains.tsx
@@ -20,7 +20,7 @@ export default function Domains() {
mutate(
`/api/teams/${teamInfo?.currentTeam?.id}/domains`,
domains?.filter((domain) => domain.slug !== deletedDomain),
- false
+ false,
);
};
@@ -28,7 +28,7 @@ export default function Domains() {
mutate(
`/api/teams/${teamInfo?.currentTeam?.id}/domains`,
[...(domains || []), newDomain],
- false
+ false,
);
};
@@ -49,7 +49,8 @@ export default function Domains() {
<AddDomainModal
open={open}
setOpen={setOpen}
- onAddition={handleDomainAddition}>
+ onAddition={handleDomainAddition}
+ >
<Button>Add Domain</Button>
</AddDomainModal>
</ul>
diff --git a/pages/settings/general.tsx b/pages/settings/general.tsx
index d2995141..e6a0c438 100644
--- a/pages/settings/general.tsx
+++ b/pages/settings/general.tsx
@@ -4,7 +4,6 @@ import { DeleteTeamModal } from "@/components/teams/delete-team-modal";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { useTeam } from "@/context/team-context";
-import { data } from "autoprefixer";
import { useRef, useState } from "react";
import { toast } from "sonner";
import { mutate } from "swr";
@@ -27,7 +26,7 @@ export default function General() {
body: JSON.stringify({
name: teamNameInputRef.current?.value,
}),
- }
+ },
);
if (response.ok) {
diff --git a/pages/welcome.tsx b/pages/welcome.tsx
index aceb3784..76cb24e6 100644
--- a/pages/welcome.tsx
+++ b/pages/welcome.tsx
@@ -8,7 +8,6 @@ import { AnimatePresence } from "framer-motion";
export default function Welcome() {
const router = useRouter();
-
return (
<div className="flex h-screen flex-col items-center justify-center max-w-3xl mx-auto overflow-x-hidden">
<div