This commit is contained in:
Benjamin Toby
2024-12-09 16:50:52 +01:00
parent b037cec100
commit 20959c3580
6 changed files with 16 additions and 7 deletions
+1 -2
View File
@@ -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;
+1 -1
View File
@@ -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;
+1 -2
View File
@@ -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 = {
@@ -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(" ");
}