[dep] update to eslint 9

This commit is contained in:
Purp1e
2024-11-11 10:04:00 +08:00
parent e308309fb8
commit b1d505fd6b
36 changed files with 353 additions and 218 deletions

View File

@@ -1,5 +1,5 @@
import { ReactNode } from "react"
import clsx from "clsx"
import type { ReactNode } from "react"
interface CardProps {
children?: ReactNode
@@ -20,23 +20,41 @@ const Card = ({ children }: CardProps) => {
}
const CardHeader = ({ children }: CardProps) => {
return <div className="flex items-center gap-1.5 tracking-wide">{children}</div>
return (
<div className="flex items-center gap-1.5 tracking-wide">{children}</div>
)
}
const CardIcon = ({ children, type, className, ...rest }: CardProps) => {
return (
<div className={clsx("flex gap-1.5 items-center font-semibold", type === "menu" && "transition cursor-pointer hover:bg-black/5 px-2 py-1 rounded-md active:scale-95", className)} {...rest}>
<div
className={clsx(
"flex gap-1.5 items-center font-semibold",
type === "menu" &&
"transition cursor-pointer hover:bg-black/5 px-2 py-1 rounded-md active:scale-95",
className,
)}
{...rest}
>
{children}
</div>
)
}
const CardTool = ({ children }: CardProps) => {
return <div className="flex items-center justify-end flex-grow gap-2">{children}</div>
return (
<div className="flex items-center justify-end flex-grow gap-2">
{children}
</div>
)
}
const CardBody = ({ children }: CardProps) => {
return <div className="w-full h-full text-sm tracking-wide text-zinc-800">{children}</div>
return (
<div className="w-full h-full text-sm tracking-wide text-zinc-800">
{children}
</div>
)
}
export { Card, CardHeader, CardIcon, CardTool, CardBody }