diff --git a/bun.lockb b/bun.lockb index a1f3179..ae27f9d 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/lib/editors/AceEditor.tsx b/components/lib/editors/AceEditor.tsx index f64cde0..f36739b 100755 --- a/components/lib/editors/AceEditor.tsx +++ b/components/lib/editors/AceEditor.tsx @@ -1,4 +1,3 @@ -import { AceEditorAcceptedModes } from "@/components/general/data/partials/EditDataListButton"; import React, { MutableRefObject } from "react"; import { twMerge } from "tailwind-merge"; @@ -9,7 +8,7 @@ export type AceEditorComponentType = { ctrlEnterFn?: (editor: AceAjax.Editor) => void; content?: string; placeholder?: string; - mode?: AceEditorAcceptedModes; + mode?: any; fontSize?: string; previewMode?: boolean; onChange?: (value: string) => void; diff --git a/components/lib/elements/Breadcrumbs.tsx b/components/lib/elements/Breadcrumbs.tsx index 4af8e57..75021f9 100755 --- a/components/lib/elements/Breadcrumbs.tsx +++ b/components/lib/elements/Breadcrumbs.tsx @@ -2,7 +2,7 @@ import React from "react"; import Link from "../layout/Link"; import Divider from "../layout/Divider"; import Row from "../layout/Row"; -import lowerToTitleCase from "@/server-client-shared/utils/lower-to-title-case"; +import lowerToTitleCase from "../utils/lower-to-title-case"; type LinkObject = { title: string; diff --git a/components/lib/utils/fetch/fetchApi.ts b/components/lib/utils/fetch/fetchApi.ts index bbdffa6..454c309 100755 --- a/components/lib/utils/fetch/fetchApi.ts +++ b/components/lib/utils/fetch/fetchApi.ts @@ -1,4 +1,3 @@ -import { AuthCsrfHeaderName } from "@/server-client-shared/types/admin/auth"; import _ from "lodash"; type FetchApiOptions = { @@ -18,7 +17,7 @@ type FetchApiOptions = { }; type FetchHeader = HeadersInit & { - [key in AuthCsrfHeaderName]?: string | null; + [key: string]: string | null; }; export type FetchApiReturn = { diff --git a/components/lib/utils/lower-to-title-case.ts b/components/lib/utils/lower-to-title-case.ts new file mode 100644 index 0000000..d979655 --- /dev/null +++ b/components/lib/utils/lower-to-title-case.ts @@ -0,0 +1,9 @@ +export default function lowerToTitleCase(str: string) { + return str + .replace(/_|-/g, " ") + .split(" ") + .map( + (word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase() + ) + .join(" "); +} diff --git a/package.json b/package.json index 12a73ac..0a3aa96 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ }, "dependencies": { "@moduletrace/datasquirel": "^2.7.4", + "lodash": "^4.17.21", "lucide-react": "^0.462.0", "next": "15.0.3", "react": "19.0.0-rc-66855b96-20241106", @@ -17,11 +18,12 @@ "tailwind-merge": "^2.5.5" }, "devDependencies": { - "typescript": "^5", + "@types/lodash": "^4.17.13", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", "postcss": "^8", - "tailwindcss": "^3.4.1" + "tailwindcss": "^3.4.1", + "typescript": "^5" } }