Revert "Upgrade linter and formatter to Ultracite" (#1226)
This commit is contained in:
parent
0e320b391d
commit
1aff7d9868
177 changed files with 8334 additions and 6943 deletions
|
|
@ -1,21 +1,23 @@
|
|||
"use client";
|
||||
'use client';
|
||||
|
||||
import { isAfter } from "date-fns";
|
||||
import { motion } from "framer-motion";
|
||||
import { useState } from "react";
|
||||
import { useSWRConfig } from "swr";
|
||||
import { useWindowSize } from "usehooks-ts";
|
||||
import { useArtifact } from "@/hooks/use-artifact";
|
||||
import type { Document } from "@/lib/db/schema";
|
||||
import { getDocumentTimestampByIndex } from "@/lib/utils";
|
||||
import { LoaderIcon } from "./icons";
|
||||
import { Button } from "./ui/button";
|
||||
import { isAfter } from 'date-fns';
|
||||
import { motion } from 'framer-motion';
|
||||
import { useState } from 'react';
|
||||
import { useSWRConfig } from 'swr';
|
||||
import { useWindowSize } from 'usehooks-ts';
|
||||
|
||||
type VersionFooterProps = {
|
||||
handleVersionChange: (type: "next" | "prev" | "toggle" | "latest") => void;
|
||||
documents: Document[] | undefined;
|
||||
import type { Document } from '@/lib/db/schema';
|
||||
import { getDocumentTimestampByIndex } from '@/lib/utils';
|
||||
|
||||
import { LoaderIcon } from './icons';
|
||||
import { Button } from './ui/button';
|
||||
import { useArtifact } from '@/hooks/use-artifact';
|
||||
|
||||
interface VersionFooterProps {
|
||||
handleVersionChange: (type: 'next' | 'prev' | 'toggle' | 'latest') => void;
|
||||
documents: Array<Document> | undefined;
|
||||
currentVersionIndex: number;
|
||||
};
|
||||
}
|
||||
|
||||
export const VersionFooter = ({
|
||||
handleVersionChange,
|
||||
|
|
@ -30,17 +32,15 @@ export const VersionFooter = ({
|
|||
const { mutate } = useSWRConfig();
|
||||
const [isMutating, setIsMutating] = useState(false);
|
||||
|
||||
if (!documents) {
|
||||
return;
|
||||
}
|
||||
if (!documents) return;
|
||||
|
||||
return (
|
||||
<motion.div
|
||||
animate={{ y: 0 }}
|
||||
className="absolute bottom-0 z-50 flex w-full flex-col justify-between gap-4 border-t bg-background p-4 lg:flex-row"
|
||||
exit={{ y: isMobile ? 200 : 77 }}
|
||||
initial={{ y: isMobile ? 200 : 77 }}
|
||||
transition={{ type: "spring", stiffness: 140, damping: 20 }}
|
||||
animate={{ y: 0 }}
|
||||
exit={{ y: isMobile ? 200 : 77 }}
|
||||
transition={{ type: 'spring', stiffness: 140, damping: 20 }}
|
||||
>
|
||||
<div>
|
||||
<div>You are viewing a previous version</div>
|
||||
|
|
@ -60,11 +60,11 @@ export const VersionFooter = ({
|
|||
await fetch(
|
||||
`/api/document?id=${artifact.documentId}×tamp=${getDocumentTimestampByIndex(
|
||||
documents,
|
||||
currentVersionIndex
|
||||
currentVersionIndex,
|
||||
)}`,
|
||||
{
|
||||
method: "DELETE",
|
||||
}
|
||||
method: 'DELETE',
|
||||
},
|
||||
),
|
||||
{
|
||||
optimisticData: documents
|
||||
|
|
@ -75,14 +75,14 @@ export const VersionFooter = ({
|
|||
new Date(
|
||||
getDocumentTimestampByIndex(
|
||||
documents,
|
||||
currentVersionIndex
|
||||
)
|
||||
)
|
||||
)
|
||||
currentVersionIndex,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
]
|
||||
: [],
|
||||
}
|
||||
},
|
||||
);
|
||||
}}
|
||||
>
|
||||
|
|
@ -94,10 +94,10 @@ export const VersionFooter = ({
|
|||
)}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
handleVersionChange("latest");
|
||||
}}
|
||||
variant="outline"
|
||||
onClick={() => {
|
||||
handleVersionChange('latest');
|
||||
}}
|
||||
>
|
||||
Back to latest version
|
||||
</Button>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue