File refactoring and react errors.

This commit is contained in:
charlesgauthereau
2025-12-21 09:59:49 +01:00
parent e953de0e06
commit 82ab2c63d6
6 changed files with 114 additions and 121 deletions
Binary file not shown.
+2 -2
View File
@@ -52,7 +52,7 @@
"@zenstackhq/runtime": "2.14.2",
"argon2": "^0.43.0",
"bcrypt": "^6.0.0",
"better-auth": "1.4.2",
"better-auth": "1.4.5",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cmdk": "^1.1.1",
@@ -66,7 +66,7 @@
"lucide-react": "^0.553.0",
"minio": "^8.0.5",
"motion": "^12.23.24",
"next": "16.0.7",
"next": "16.0.10",
"next-safe-action": "^7.10.8",
"next-themes": "^0.4.6",
"node-cron": "^4.2.1",
@@ -1,36 +1,3 @@
// import Link from "next/link";
// import {cn} from "@/lib/utils";
// import {Plus} from "lucide-react";
//
// type EmptyStatePlaceholderProps = {
// url?: string;
// text: string;
// className?: string;
// }
//
// export const EmptyStatePlaceholder = ({url, text, className}: EmptyStatePlaceholderProps) => {
// return (
// <div className={cn("",className)}>{url ?
// <Link
// href={url}
// className={cn(
// "h-full",
// "flex flex-col items-center justify-center w-full rounded-2xl border border-dashed border-muted p-6 lg:p-10",
// "hover:bg-muted/50 transition-colors text-muted-foreground hover:text-primary text-center space-y-2"
// )}
// >
// <Plus className="w-5 h-5 lg:w-6 lg:h-6"/>
// <span className="text-sm lg:text-base font-medium">{text}</span>
// </Link>
// :
// <div className="flex h-full flex-col items-center justify-center py-12 text-center">
// <p className="text-lg text-muted-foreground">{text}</p>
// </div>
// }
// </div>
//
// )
// }
import Link from "next/link";
import {cn} from "@/lib/utils";
import {Plus} from "lucide-react";
@@ -48,25 +15,27 @@ export const EmptyStatePlaceholder = ({
text,
className,
}: EmptyStatePlaceholderProps) => {
const content = (
const Container = (
<div
className={cn(
"flex h-full flex-col items-center justify-center w-full rounded-2xl border border-dashed border-muted p-6 lg:p-10",
"hover:bg-muted/50 transition-colors text-muted-foreground hover:text-primary text-center space-y-4 cursor-pointer",
onClick || url ? "cursor-pointer" : "cursor-default"
"hover:bg-muted/50 transition-colors text-muted-foreground hover:text-primary text-center space-y-4",
(onClick || url) && "cursor-pointer"
)}
{...(onClick ? {onClick} : url ? {asChild: true} : {})}
onClick={onClick}
>
<Plus className="w-5 h-5 lg:w-6 lg:h-6"/>
<div>
<p className="text-sm ">{text}</p>
</div>
<Plus className="w-5 h-5 lg:w-6 lg:h-6" />
<p className="text-sm">{text}</p>
</div>
);
return (
<div className={cn("", className)}>
{url ? <Link href={url}>{content}</Link> : content}
</div>
);
};
if (url) {
return (
<div className={cn(className)}>
<Link href={url}>{Container}</Link>
</div>
);
}
return <div className={cn(className)}>{Container}</div>;
};
@@ -24,7 +24,7 @@ export const SidebarLogo = ({projectName}: {
return (
<div className="ml-1 flex items-center justify-center">
<Link href={"/"}>
<Link href={"/dashboard/home"}>
{state === 'collapsed' && !isMobile ? (
<Image
loading="eager"
@@ -91,7 +91,7 @@ export const SidebarMenuCustomBase = ({ baseUrl, items }: SidebarMenuCustomBaseP
<Collapsible key={index} defaultOpen className="group/group-collapsible">
<SidebarGroup>
<SidebarGroupLabel asChild>
<CollapsibleTrigger className="flex w-full items-center text-sm font-medium text-sidebar-foreground/70">
<CollapsibleTrigger disabled={group.type == "list"} className="flex w-full items-center text-sm font-medium text-sidebar-foreground/70">
{group.label}
{group.type === "collapse" && (
<ChevronDown className="ml-auto h-4 w-4 transition-transform group-data-[state=open]/group-collapsible:rotate-180" />
+94 -70
View File
@@ -760,32 +760,32 @@ __metadata:
languageName: node
linkType: hard
"@better-auth/core@npm:1.4.2":
version: 1.4.2
resolution: "@better-auth/core@npm:1.4.2"
"@better-auth/core@npm:1.4.5":
version: 1.4.5
resolution: "@better-auth/core@npm:1.4.5"
dependencies:
"@standard-schema/spec": "npm:^1.0.0"
zod: "npm:^4.1.12"
peerDependencies:
"@better-auth/utils": 0.3.0
"@better-fetch/fetch": 1.1.18
better-call: 1.1.0
better-call: 1.1.4
jose: ^6.1.0
kysely: ^0.28.5
nanostores: ^1.0.1
checksum: 10c0/2a0cc9461b251a29e0488d4fe398440ff25a6d4df8a5d1a4943244af4244835de6c004cac222e973d6f1670eebe3b4dfe0adf9fc1ee2b696b27d3e1620f994d0
checksum: 10c0/f8ad4245db4bfbeea0c9d333c00f86cc7a8937a06cb57852aa3f3393a113efc8a8094cf2f7b199903a08e128d3bbd0bff253887a2b2252676097b983a26c7481
languageName: node
linkType: hard
"@better-auth/telemetry@npm:1.4.2":
version: 1.4.2
resolution: "@better-auth/telemetry@npm:1.4.2"
"@better-auth/telemetry@npm:1.4.5":
version: 1.4.5
resolution: "@better-auth/telemetry@npm:1.4.5"
dependencies:
"@better-auth/utils": "npm:0.3.0"
"@better-fetch/fetch": "npm:1.1.18"
peerDependencies:
"@better-auth/core": 1.4.2
checksum: 10c0/29990e7ffcc9c64347c614e12afe63f57780ac6b6ef0e32782d7c6e72e3c097bf76f980ceb943b6674fd56d17f3dfb1c0f391e76ca91f37740b71e47df6d78e9
"@better-auth/core": 1.4.5
checksum: 10c0/f3308474060b1ed4c854ceb0628a635abffae66a9990d45d797c77d250e73ca414fd67f171b5667974b9fd7bfa840bdafa560df530677423a5feca89f44b2520
languageName: node
linkType: hard
@@ -2406,10 +2406,10 @@ __metadata:
languageName: node
linkType: hard
"@next/env@npm:16.0.7":
version: 16.0.7
resolution: "@next/env@npm:16.0.7"
checksum: 10c0/5bbb4360ae6b0753de83f70700295c09427f5414f6765c7371fee0894de2a614364a2e9b4ec7b7e3451d56334026bafec6d28a21222a2fa7ecaa27f0a9421cc7
"@next/env@npm:16.0.10":
version: 16.0.10
resolution: "@next/env@npm:16.0.10"
checksum: 10c0/6f2b5ba37733a49513ab3117c06f037fa962b4022fe2b4ba7801f830ab15974ad87ad8b47b6464fa5fcb3e9a3247b25f657ec97ae6eed1156b5736c6388246db
languageName: node
linkType: hard
@@ -2429,9 +2429,9 @@ __metadata:
languageName: node
linkType: hard
"@next/swc-darwin-arm64@npm:16.0.7":
version: 16.0.7
resolution: "@next/swc-darwin-arm64@npm:16.0.7"
"@next/swc-darwin-arm64@npm:16.0.10":
version: 16.0.10
resolution: "@next/swc-darwin-arm64@npm:16.0.10"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard
@@ -2443,9 +2443,9 @@ __metadata:
languageName: node
linkType: hard
"@next/swc-darwin-x64@npm:16.0.7":
version: 16.0.7
resolution: "@next/swc-darwin-x64@npm:16.0.7"
"@next/swc-darwin-x64@npm:16.0.10":
version: 16.0.10
resolution: "@next/swc-darwin-x64@npm:16.0.10"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard
@@ -2457,9 +2457,9 @@ __metadata:
languageName: node
linkType: hard
"@next/swc-linux-arm64-gnu@npm:16.0.7":
version: 16.0.7
resolution: "@next/swc-linux-arm64-gnu@npm:16.0.7"
"@next/swc-linux-arm64-gnu@npm:16.0.10":
version: 16.0.10
resolution: "@next/swc-linux-arm64-gnu@npm:16.0.10"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard
@@ -2471,9 +2471,9 @@ __metadata:
languageName: node
linkType: hard
"@next/swc-linux-arm64-musl@npm:16.0.7":
version: 16.0.7
resolution: "@next/swc-linux-arm64-musl@npm:16.0.7"
"@next/swc-linux-arm64-musl@npm:16.0.10":
version: 16.0.10
resolution: "@next/swc-linux-arm64-musl@npm:16.0.10"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard
@@ -2485,9 +2485,9 @@ __metadata:
languageName: node
linkType: hard
"@next/swc-linux-x64-gnu@npm:16.0.7":
version: 16.0.7
resolution: "@next/swc-linux-x64-gnu@npm:16.0.7"
"@next/swc-linux-x64-gnu@npm:16.0.10":
version: 16.0.10
resolution: "@next/swc-linux-x64-gnu@npm:16.0.10"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard
@@ -2499,9 +2499,9 @@ __metadata:
languageName: node
linkType: hard
"@next/swc-linux-x64-musl@npm:16.0.7":
version: 16.0.7
resolution: "@next/swc-linux-x64-musl@npm:16.0.7"
"@next/swc-linux-x64-musl@npm:16.0.10":
version: 16.0.10
resolution: "@next/swc-linux-x64-musl@npm:16.0.10"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard
@@ -2513,9 +2513,9 @@ __metadata:
languageName: node
linkType: hard
"@next/swc-win32-arm64-msvc@npm:16.0.7":
version: 16.0.7
resolution: "@next/swc-win32-arm64-msvc@npm:16.0.7"
"@next/swc-win32-arm64-msvc@npm:16.0.10":
version: 16.0.10
resolution: "@next/swc-win32-arm64-msvc@npm:16.0.10"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard
@@ -2527,9 +2527,9 @@ __metadata:
languageName: node
linkType: hard
"@next/swc-win32-x64-msvc@npm:16.0.7":
version: 16.0.7
resolution: "@next/swc-win32-x64-msvc@npm:16.0.7"
"@next/swc-win32-x64-msvc@npm:16.0.10":
version: 16.0.10
resolution: "@next/swc-win32-x64-msvc@npm:16.0.10"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard
@@ -6616,28 +6616,40 @@ __metadata:
languageName: node
linkType: hard
"better-auth@npm:1.4.2":
version: 1.4.2
resolution: "better-auth@npm:1.4.2"
"better-auth@npm:1.4.5":
version: 1.4.5
resolution: "better-auth@npm:1.4.5"
dependencies:
"@better-auth/core": "npm:1.4.2"
"@better-auth/telemetry": "npm:1.4.2"
"@better-auth/core": "npm:1.4.5"
"@better-auth/telemetry": "npm:1.4.5"
"@better-auth/utils": "npm:0.3.0"
"@better-fetch/fetch": "npm:1.1.18"
"@noble/ciphers": "npm:^2.0.0"
"@noble/hashes": "npm:^2.0.0"
"@standard-schema/spec": "npm:^1.0.0"
better-call: "npm:1.1.0"
better-call: "npm:1.1.4"
defu: "npm:^6.1.4"
jose: "npm:^6.1.0"
kysely: "npm:^0.28.5"
ms: "npm:4.0.0-nightly.202508271359"
nanostores: "npm:^1.0.1"
zod: "npm:^4.1.12"
peerDependencies:
"@lynx-js/react": "*"
"@sveltejs/kit": ^2.0.0
"@tanstack/react-start": ^1.0.0
next: ^14.0.0 || ^15.0.0 || ^16.0.0
react: ^18.0.0 || ^19.0.0
react-dom: ^18.0.0 || ^19.0.0
solid-js: ^1.0.0
svelte: ^4.0.0 || ^5.0.0
vue: ^3.0.0
peerDependenciesMeta:
"@lynx-js/react":
optional: true
"@sveltejs/kit":
optional: true
"@tanstack/react-start":
optional: true
next:
optional: true
react:
@@ -6650,19 +6662,24 @@ __metadata:
optional: true
vue:
optional: true
checksum: 10c0/7b4c37bd74eaa3cb46c647d3504945a9062f389807a1779aa3e1254a512139c2d63afc31547cfe9f5a06972557fe5ba53297a77aed79f93d932ac3c548cf54c6
checksum: 10c0/ecf67cd58f012072aa20a65a640845ae1a67eddb771506157562d840990d13e03b7c4c11142d5b113110add456b29b63f6ed06b68cff4c212adf3e824d7053b3
languageName: node
linkType: hard
"better-call@npm:1.1.0":
version: 1.1.0
resolution: "better-call@npm:1.1.0"
"better-call@npm:1.1.4":
version: 1.1.4
resolution: "better-call@npm:1.1.4"
dependencies:
"@better-auth/utils": "npm:^0.3.0"
"@better-fetch/fetch": "npm:^1.1.4"
rou3: "npm:^0.5.1"
rou3: "npm:^0.7.10"
set-cookie-parser: "npm:^2.7.1"
checksum: 10c0/400fa8d9880ee934d684aed5c6c7136905494689db10f94f719825ec33436acd30f20685a7121630803637c4d4fc2306863950fced6e98726825d65d6b3d9089
peerDependencies:
zod: ^4.0.0
peerDependenciesMeta:
zod:
optional: true
checksum: 10c0/63d278f42409e9ffbfed7c5d14de761b3c3b7c022267f330223aaafd65af8bd04a3ff9959337102244c31bc5c1a01975bdc99060c5a32dadf5eeda784d1e8169
languageName: node
linkType: hard
@@ -10880,6 +10897,13 @@ __metadata:
languageName: node
linkType: hard
"ms@npm:4.0.0-nightly.202508271359":
version: 4.0.0-nightly.202508271359
resolution: "ms@npm:4.0.0-nightly.202508271359"
checksum: 10c0/924aadb4a82c2938d72ecc8a80dc0c59ead03467fce20e7d5ef73849bbee126c566a0602b95af2885dbfc4b846a25fe62ec1b0add9cdc1b0ad009f551a042845
languageName: node
linkType: hard
"ms@npm:^2.1.1, ms@npm:^2.1.3":
version: 2.1.3
resolution: "ms@npm:2.1.3"
@@ -11053,19 +11077,19 @@ __metadata:
languageName: node
linkType: hard
"next@npm:16.0.7":
version: 16.0.7
resolution: "next@npm:16.0.7"
"next@npm:16.0.10":
version: 16.0.10
resolution: "next@npm:16.0.10"
dependencies:
"@next/env": "npm:16.0.7"
"@next/swc-darwin-arm64": "npm:16.0.7"
"@next/swc-darwin-x64": "npm:16.0.7"
"@next/swc-linux-arm64-gnu": "npm:16.0.7"
"@next/swc-linux-arm64-musl": "npm:16.0.7"
"@next/swc-linux-x64-gnu": "npm:16.0.7"
"@next/swc-linux-x64-musl": "npm:16.0.7"
"@next/swc-win32-arm64-msvc": "npm:16.0.7"
"@next/swc-win32-x64-msvc": "npm:16.0.7"
"@next/env": "npm:16.0.10"
"@next/swc-darwin-arm64": "npm:16.0.10"
"@next/swc-darwin-x64": "npm:16.0.10"
"@next/swc-linux-arm64-gnu": "npm:16.0.10"
"@next/swc-linux-arm64-musl": "npm:16.0.10"
"@next/swc-linux-x64-gnu": "npm:16.0.10"
"@next/swc-linux-x64-musl": "npm:16.0.10"
"@next/swc-win32-arm64-msvc": "npm:16.0.10"
"@next/swc-win32-x64-msvc": "npm:16.0.10"
"@swc/helpers": "npm:0.5.15"
caniuse-lite: "npm:^1.0.30001579"
postcss: "npm:8.4.31"
@@ -11108,7 +11132,7 @@ __metadata:
optional: true
bin:
next: dist/bin/next
checksum: 10c0/72003fed0f5b690c91ae1a0cc59317691ca1976b46809557a93e00a43e55d4158a256b1a46da6cd7506e699d74aa0cf4e973ec5a35ceabbdd9a1955b507ec85d
checksum: 10c0/c0e42bfaa0d38b0ee9a7fc54c748da2dfd807a76d75278b4c4f06768965d7b1035b836cae45e24a074dcf156a13c0fa555caa652886cc0f93e8be2b296dfbb51
languageName: node
linkType: hard
@@ -11812,7 +11836,7 @@ __metadata:
argon2: "npm:^0.43.0"
baseline-browser-mapping: "npm:^2.8.32"
bcrypt: "npm:^6.0.0"
better-auth: "npm:1.4.2"
better-auth: "npm:1.4.5"
class-variance-authority: "npm:^0.7.1"
clsx: "npm:^2.1.1"
cmdk: "npm:^1.1.1"
@@ -11830,7 +11854,7 @@ __metadata:
lucide-react: "npm:^0.553.0"
minio: "npm:^8.0.5"
motion: "npm:^12.23.24"
next: "npm:16.0.7"
next: "npm:16.0.10"
next-safe-action: "npm:^7.10.8"
next-themes: "npm:^0.4.6"
node-cron: "npm:^4.2.1"
@@ -12609,10 +12633,10 @@ __metadata:
languageName: node
linkType: hard
"rou3@npm:^0.5.1":
version: 0.5.1
resolution: "rou3@npm:0.5.1"
checksum: 10c0/4ec56564829fe9b627aa5bbd7ded5d8f4a4c0c5baeda59941cdbd4c9b2336689b0005f28e1c1047bb527c44a5dba7e3b89ef0221b6aa35c790029b6508fb2761
"rou3@npm:^0.7.10":
version: 0.7.12
resolution: "rou3@npm:0.7.12"
checksum: 10c0/2ea87ddd91a5d0f9d9671fa2bb714f57566eae33ecb24e8a61bb298aca8c226483e59cafe1c60297ac9aa58b2b6ad506447374cdbff4e99cf0f9f72a9dae09dc
languageName: node
linkType: hard