Merge pull request #73 from bknd-io/feat/cf-d1-and-r2

adding d1 and r2 for cloudflare environments
This commit is contained in:
dswbx
2025-02-12 09:04:47 +01:00
committed by GitHub
20 changed files with 387 additions and 175 deletions

View File

@@ -22,11 +22,7 @@ declare module "@mantine/modals" {
}
export function BkndModalsProvider({ children }) {
return (
<ModalsProvider modals={modals} modalProps={{ className: "bknd-admin" }}>
{children}
</ModalsProvider>
);
return <ModalsProvider modals={modals}>{children}</ModalsProvider>;
}
function open<Modal extends keyof typeof modals>(

View File

@@ -1,4 +1,4 @@
import { IconBrandAws, IconCloud, IconServer } from "@tabler/icons-react";
import { IconBrandAws, IconBrandCloudflare, IconCloud, IconServer } from "@tabler/icons-react";
import { isDebug } from "core";
import { autoFormatString } from "core/utils";
import { twMerge } from "tailwind-merge";
@@ -113,10 +113,15 @@ const RootFormError = () => {
);
};
const Icons = [IconBrandAws, IconCloud, IconServer];
const Icons = {
s3: IconBrandAws,
cloudinary: IconCloud,
local: IconServer,
r2: IconBrandCloudflare
};
const AdapterIcon = ({ index }: { index: number }) => {
const Icon = Icons[index];
const AdapterIcon = ({ type }: { type: string }) => {
const Icon = Icons[type];
if (!Icon) return null;
return <Icon />;
};
@@ -142,7 +147,7 @@ function Adapters() {
)}
>
<div>
<AdapterIcon index={i} />
<AdapterIcon type={schema.properties.type.const} />
</div>
<div className="flex flex-col items-start justify-center">
<span>{autoFormatString(schema.title)}</span>