diff --git a/apps/bridge-frontend/app/(login)/login/page.tsx b/apps/bridge-frontend/app/(login)/login/page.tsx
new file mode 100644
index 0000000..8f79c27
--- /dev/null
+++ b/apps/bridge-frontend/app/(login)/login/page.tsx
@@ -0,0 +1,14 @@
+import { Metadata } from "next";
+import { getSession } from "next-auth/react";
+import { Login } from "@/app/_components/Login";
+
+export const dynamic = "force-dynamic";
+
+export const metadata: Metadata = {
+ title: "Login",
+};
+
+export default async function Page() {
+ const session = await getSession();
+ return ;
+}
diff --git a/apps/bridge-frontend/app/facebook/[id]/edit/page.tsx b/apps/bridge-frontend/app/(main)/facebook/[id]/edit/page.tsx
similarity index 100%
rename from apps/bridge-frontend/app/facebook/[id]/edit/page.tsx
rename to apps/bridge-frontend/app/(main)/facebook/[id]/edit/page.tsx
diff --git a/apps/bridge-frontend/app/facebook/[id]/page.tsx b/apps/bridge-frontend/app/(main)/facebook/[id]/page.tsx
similarity index 100%
rename from apps/bridge-frontend/app/facebook/[id]/page.tsx
rename to apps/bridge-frontend/app/(main)/facebook/[id]/page.tsx
diff --git a/apps/bridge-frontend/app/whatsapp/page.tsx b/apps/bridge-frontend/app/(main)/facebook/_components/FacebookBotsList.tsx
similarity index 70%
rename from apps/bridge-frontend/app/whatsapp/page.tsx
rename to apps/bridge-frontend/app/(main)/facebook/_components/FacebookBotsList.tsx
index 86e921e..5a16ad2 100644
--- a/apps/bridge-frontend/app/whatsapp/page.tsx
+++ b/apps/bridge-frontend/app/(main)/facebook/_components/FacebookBotsList.tsx
@@ -1,10 +1,14 @@
+"use client";
+
+import { FC } from "react";
import { GridColDef } from "@mui/x-data-grid-pro";
-import { List } from "ui";
-// import { db } from "@/app/_lib/database";
+import { List } from "@/app/_components/List";
-export const dynamic = "force-dynamic";
+type FacebookBotsListProps = {
+ rows: any[];
+};
-export default async function Page() {
+export const FacebookBotsList: FC = ({ rows }) => {
const columns: GridColDef[] = [
{
field: "id",
@@ -32,14 +36,12 @@ export default async function Page() {
},
];
- const rows: any = []; // await db.selectFrom("WhatsAppBot").selectAll().execute();
-
return (
{}}
/>
);
-}
+};
diff --git a/apps/bridge-frontend/app/facebook/new/page.tsx b/apps/bridge-frontend/app/(main)/facebook/new/page.tsx
similarity index 100%
rename from apps/bridge-frontend/app/facebook/new/page.tsx
rename to apps/bridge-frontend/app/(main)/facebook/new/page.tsx
diff --git a/apps/bridge-frontend/app/(main)/facebook/page.tsx b/apps/bridge-frontend/app/(main)/facebook/page.tsx
new file mode 100644
index 0000000..6efd5c2
--- /dev/null
+++ b/apps/bridge-frontend/app/(main)/facebook/page.tsx
@@ -0,0 +1,10 @@
+import { FacebookBotsList } from "./_components/FacebookBotsList";
+import { db } from "@/app/_lib/database";
+
+export const dynamic = "force-dynamic";
+
+export default async function Page() {
+ const rows = await db.selectFrom("FacebookBot").selectAll().execute();
+
+ return ;
+}
diff --git a/apps/bridge-frontend/app/(main)/layout.tsx b/apps/bridge-frontend/app/(main)/layout.tsx
new file mode 100644
index 0000000..32203a2
--- /dev/null
+++ b/apps/bridge-frontend/app/(main)/layout.tsx
@@ -0,0 +1,9 @@
+import { InternalLayout } from "@/app/_components/InternalLayout";
+
+export default function Layout({
+ children,
+}: Readonly<{
+ children: React.ReactNode;
+}>) {
+ return {children};
+}
diff --git a/apps/bridge-frontend/app/page.tsx b/apps/bridge-frontend/app/(main)/page.tsx
similarity index 100%
rename from apps/bridge-frontend/app/page.tsx
rename to apps/bridge-frontend/app/(main)/page.tsx
diff --git a/apps/bridge-frontend/app/signal/[id]/page.tsx b/apps/bridge-frontend/app/(main)/signal/[id]/page.tsx
similarity index 100%
rename from apps/bridge-frontend/app/signal/[id]/page.tsx
rename to apps/bridge-frontend/app/(main)/signal/[id]/page.tsx
diff --git a/apps/bridge-frontend/app/voice/page.tsx b/apps/bridge-frontend/app/(main)/signal/_components/SignalBotsList.tsx
similarity index 68%
rename from apps/bridge-frontend/app/voice/page.tsx
rename to apps/bridge-frontend/app/(main)/signal/_components/SignalBotsList.tsx
index 61352d8..bf141a2 100644
--- a/apps/bridge-frontend/app/voice/page.tsx
+++ b/apps/bridge-frontend/app/(main)/signal/_components/SignalBotsList.tsx
@@ -1,9 +1,14 @@
"use client";
+import { FC } from "react";
import { GridColDef } from "@mui/x-data-grid-pro";
-import { List } from "ui";
+import { List } from "@/app/_components/List";
-export default function Page() {
+type SignalBotsListProps = {
+ rows: any[];
+};
+
+export const SignalBotsList: FC = ({ rows }) => {
const columns: GridColDef[] = [
{
field: "id",
@@ -31,14 +36,7 @@ export default function Page() {
},
];
- const rows = [
- {
- id: 10,
- phoneNumber: "1234567890",
- createdAt: new Date(),
- updatedAt: new Date(),
- },
- ];
-
- return
;
-}
+ return (
+
+ );
+};
diff --git a/apps/bridge-frontend/app/signal/new/page.tsx b/apps/bridge-frontend/app/(main)/signal/new/page.tsx
similarity index 100%
rename from apps/bridge-frontend/app/signal/new/page.tsx
rename to apps/bridge-frontend/app/(main)/signal/new/page.tsx
diff --git a/apps/bridge-frontend/app/(main)/signal/page.tsx b/apps/bridge-frontend/app/(main)/signal/page.tsx
new file mode 100644
index 0000000..8ce8e62
--- /dev/null
+++ b/apps/bridge-frontend/app/(main)/signal/page.tsx
@@ -0,0 +1,10 @@
+import { SignalBotsList } from "./_components/SignalBotsList";
+import { db } from "@/app/_lib/database";
+
+export const dynamic = "force-dynamic";
+
+export default async function Page() {
+ const rows = await db.selectFrom("SignalBot").selectAll().execute();
+
+ return ;
+}
diff --git a/apps/bridge-frontend/app/(main)/users/_components/UsersList.tsx b/apps/bridge-frontend/app/(main)/users/_components/UsersList.tsx
new file mode 100644
index 0000000..8672ac9
--- /dev/null
+++ b/apps/bridge-frontend/app/(main)/users/_components/UsersList.tsx
@@ -0,0 +1,31 @@
+"use client";
+
+import { FC } from "react";
+import { GridColDef } from "@mui/x-data-grid-pro";
+import { List } from "@/app/_components/List";
+
+type UsersListProps = {
+ rows: any[];
+};
+
+export const UsersList: FC = ({ rows }) => {
+ const columns: GridColDef[] = [
+ {
+ field: "name",
+ headerName: "Name",
+ flex: 2,
+ },
+ {
+ field: "email",
+ headerName: "Email",
+ flex: 2,
+ },
+ {
+ field: "emailVerified",
+ headerName: "Verified",
+ flex: 1,
+ },
+ ];
+
+ return
;
+};
diff --git a/apps/bridge-frontend/app/(main)/users/page.tsx b/apps/bridge-frontend/app/(main)/users/page.tsx
new file mode 100644
index 0000000..c13f988
--- /dev/null
+++ b/apps/bridge-frontend/app/(main)/users/page.tsx
@@ -0,0 +1,11 @@
+import { UsersList } from "./_components/UsersList";
+import { db } from "@/app/_lib/database";
+
+export const dynamic = "force-dynamic";
+
+export default async function Page() {
+ const rows = await db.selectFrom("User").selectAll().execute();
+ console.log(rows);
+
+ return ;
+}
diff --git a/apps/bridge-frontend/app/voice/[id]/edit/page.tsx b/apps/bridge-frontend/app/(main)/voice/[id]/edit/page.tsx
similarity index 100%
rename from apps/bridge-frontend/app/voice/[id]/edit/page.tsx
rename to apps/bridge-frontend/app/(main)/voice/[id]/edit/page.tsx
diff --git a/apps/bridge-frontend/app/voice/[id]/page.tsx b/apps/bridge-frontend/app/(main)/voice/[id]/page.tsx
similarity index 100%
rename from apps/bridge-frontend/app/voice/[id]/page.tsx
rename to apps/bridge-frontend/app/(main)/voice/[id]/page.tsx
diff --git a/apps/bridge-frontend/app/facebook/page.tsx b/apps/bridge-frontend/app/(main)/voice/_components/VoiceBotsList.tsx
similarity index 69%
rename from apps/bridge-frontend/app/facebook/page.tsx
rename to apps/bridge-frontend/app/(main)/voice/_components/VoiceBotsList.tsx
index 75ca98e..9eddf8c 100644
--- a/apps/bridge-frontend/app/facebook/page.tsx
+++ b/apps/bridge-frontend/app/(main)/voice/_components/VoiceBotsList.tsx
@@ -1,9 +1,14 @@
"use client";
+import { FC } from "react";
import { GridColDef } from "@mui/x-data-grid-pro";
-import { List } from "ui";
+import { List } from "@/app/_components/List";
-export default function Page() {
+type VoiceBotsListProps = {
+ rows: any[];
+};
+
+export const VoiceBotsList: FC = ({ rows }) => {
const columns: GridColDef[] = [
{
field: "id",
@@ -31,14 +36,5 @@ export default function Page() {
},
];
- const rows = [
- {
- id: 10,
- phoneNumber: "1234567890",
- createdAt: new Date(),
- updatedAt: new Date(),
- },
- ];
-
- return
;
-}
+ return
;
+};
diff --git a/apps/bridge-frontend/app/voice/new/page.tsx b/apps/bridge-frontend/app/(main)/voice/new/page.tsx
similarity index 100%
rename from apps/bridge-frontend/app/voice/new/page.tsx
rename to apps/bridge-frontend/app/(main)/voice/new/page.tsx
diff --git a/apps/bridge-frontend/app/(main)/voice/page.tsx b/apps/bridge-frontend/app/(main)/voice/page.tsx
new file mode 100644
index 0000000..393ca43
--- /dev/null
+++ b/apps/bridge-frontend/app/(main)/voice/page.tsx
@@ -0,0 +1,10 @@
+import { VoiceBotsList } from "./_components/VoiceBotsList";
+import { db } from "@/app/_lib/database";
+
+export const dynamic = "force-dynamic";
+
+export default async function Page() {
+ const rows = await db.selectFrom("VoiceLine").selectAll().execute();
+
+ return ;
+}
diff --git a/apps/bridge-frontend/app/users/page.tsx b/apps/bridge-frontend/app/(main)/webhooks/_components/WebhooksList.tsx
similarity index 68%
rename from apps/bridge-frontend/app/users/page.tsx
rename to apps/bridge-frontend/app/(main)/webhooks/_components/WebhooksList.tsx
index 9ea005c..93f02a1 100644
--- a/apps/bridge-frontend/app/users/page.tsx
+++ b/apps/bridge-frontend/app/(main)/webhooks/_components/WebhooksList.tsx
@@ -1,9 +1,14 @@
"use client";
+import { FC } from "react";
import { GridColDef } from "@mui/x-data-grid-pro";
-import { List } from "ui";
+import { List } from "@/app/_components/List";
-export default function Page() {
+type WebhooksListProps = {
+ rows: any[];
+};
+
+export const WebhooksList: FC = ({ rows }) => {
const columns: GridColDef[] = [
{
field: "id",
@@ -31,14 +36,7 @@ export default function Page() {
},
];
- const rows = [
- {
- id: 10,
- phoneNumber: "1234567890",
- createdAt: new Date(),
- updatedAt: new Date(),
- },
- ];
-
- return
;
-}
+ return (
+
+ );
+};
diff --git a/apps/bridge-frontend/app/(main)/webhooks/page.tsx b/apps/bridge-frontend/app/(main)/webhooks/page.tsx
new file mode 100644
index 0000000..82316a5
--- /dev/null
+++ b/apps/bridge-frontend/app/(main)/webhooks/page.tsx
@@ -0,0 +1,11 @@
+import { WebhooksList } from "./_components/WebhooksList";
+import { db } from "@/app/_lib/database";
+
+export const dynamic = "force-dynamic";
+
+export default async function Page() {
+ const rows = await db.selectFrom("Webhook").selectAll().execute();
+ console.log(rows);
+
+ return ;
+}
diff --git a/apps/bridge-frontend/app/whatsapp/[id]/edit/page.tsx b/apps/bridge-frontend/app/(main)/whatsapp/[id]/edit/page.tsx
similarity index 100%
rename from apps/bridge-frontend/app/whatsapp/[id]/edit/page.tsx
rename to apps/bridge-frontend/app/(main)/whatsapp/[id]/edit/page.tsx
diff --git a/apps/bridge-frontend/app/whatsapp/[id]/page.tsx b/apps/bridge-frontend/app/(main)/whatsapp/[id]/page.tsx
similarity index 100%
rename from apps/bridge-frontend/app/whatsapp/[id]/page.tsx
rename to apps/bridge-frontend/app/(main)/whatsapp/[id]/page.tsx
diff --git a/apps/bridge-frontend/app/signal/page.tsx b/apps/bridge-frontend/app/(main)/whatsapp/_components/WhatsappList.tsx
similarity index 66%
rename from apps/bridge-frontend/app/signal/page.tsx
rename to apps/bridge-frontend/app/(main)/whatsapp/_components/WhatsappList.tsx
index b4cf218..3fd2e71 100644
--- a/apps/bridge-frontend/app/signal/page.tsx
+++ b/apps/bridge-frontend/app/(main)/whatsapp/_components/WhatsappList.tsx
@@ -1,9 +1,14 @@
"use client";
+import { FC } from "react";
import { GridColDef } from "@mui/x-data-grid-pro";
-import { List } from "ui";
+import { List } from "@/app/_components/List";
-export default function Page() {
+type WhatsappListProps = {
+ rows: any[];
+};
+
+export const WhatsappList: FC = ({ rows }) => {
const columns: GridColDef[] = [
{
field: "id",
@@ -31,14 +36,12 @@ export default function Page() {
},
];
- const rows = [
- {
- id: 10,
- phoneNumber: "1234567890",
- createdAt: new Date(),
- updatedAt: new Date(),
- },
- ];
-
- return
;
-}
+ return (
+
+ );
+};
diff --git a/apps/bridge-frontend/app/whatsapp/new/page.tsx b/apps/bridge-frontend/app/(main)/whatsapp/new/page.tsx
similarity index 100%
rename from apps/bridge-frontend/app/whatsapp/new/page.tsx
rename to apps/bridge-frontend/app/(main)/whatsapp/new/page.tsx
diff --git a/apps/bridge-frontend/app/(main)/whatsapp/page.tsx b/apps/bridge-frontend/app/(main)/whatsapp/page.tsx
new file mode 100644
index 0000000..c9e1aa0
--- /dev/null
+++ b/apps/bridge-frontend/app/(main)/whatsapp/page.tsx
@@ -0,0 +1,11 @@
+import { WhatsappList } from "./_components/WhatsappList";
+import { db } from "@/app/_lib/database";
+
+export const dynamic = "force-dynamic";
+
+export default async function Page() {
+ const rows = await db.selectFrom("WhatsappBot").selectAll().execute();
+ console.log(rows);
+
+ return ;
+}
diff --git a/apps/bridge-frontend/app/_actions/bots.ts b/apps/bridge-frontend/app/_actions/bots.ts
index e69de29..908fe79 100644
--- a/apps/bridge-frontend/app/_actions/bots.ts
+++ b/apps/bridge-frontend/app/_actions/bots.ts
@@ -0,0 +1 @@
+"use server";
diff --git a/apps/bridge-frontend/app/_components/Detail.tsx b/apps/bridge-frontend/app/_components/Detail.tsx
index fdf45e9..3bccb7b 100644
--- a/apps/bridge-frontend/app/_components/Detail.tsx
+++ b/apps/bridge-frontend/app/_components/Detail.tsx
@@ -1,7 +1,7 @@
"use client";
import { FC } from "react";
-import { Grid, Box } from "@mui/material";
+import { Grid, Box, Dialog } from "@mui/material";
import { useRouter } from "next/navigation";
import { typography } from "@/app/_styles/theme";
@@ -16,15 +16,20 @@ export const Detail: FC = ({ title, entity, children }) => {
const { h3 } = typography;
return (
-
-
-
- {title}
+
-
+
+
);
};
diff --git a/apps/bridge-frontend/app/_components/InternalLayout.tsx b/apps/bridge-frontend/app/_components/InternalLayout.tsx
index cd96429..6fa08ea 100644
--- a/apps/bridge-frontend/app/_components/InternalLayout.tsx
+++ b/apps/bridge-frontend/app/_components/InternalLayout.tsx
@@ -2,14 +2,10 @@
import { FC, PropsWithChildren, useState } from "react";
import { Grid } from "@mui/material";
-import { Sidebar } from "./Sidebar";
import { CssBaseline } from "@mui/material";
import { css, Global } from "@emotion/react";
import { fonts } from "@/app/_styles/theme";
-
-type LayoutProps = PropsWithChildren<{
- docs?: any;
-}>;
+import { Sidebar } from "./Sidebar";
export const InternalLayout: FC = ({ children }) => {
const [open, setOpen] = useState(true);
@@ -28,7 +24,7 @@ export const InternalLayout: FC = ({ children }) => {
{children as any}
diff --git a/apps/bridge-frontend/app/_components/List.tsx b/apps/bridge-frontend/app/_components/List.tsx
index 65bb96d..0762ee6 100644
--- a/apps/bridge-frontend/app/_components/List.tsx
+++ b/apps/bridge-frontend/app/_components/List.tsx
@@ -1,10 +1,9 @@
"use client";
import { FC } from "react";
-import { Grid, Box } from "@mui/material";
-import { DataGridPro, GridColDef } from "@mui/x-data-grid-pro";
+import { GridColDef } from "@mui/x-data-grid-pro";
import { useRouter } from "next/navigation";
-import { typography } from "@/app/_styles/theme";
+import { List as InternalList } from "ui";
interface ListProps {
title: string;
@@ -15,72 +14,17 @@ interface ListProps {
export const List: FC = ({ title, entity, rows, columns }) => {
const router = useRouter();
- const { h3 } = typography;
const onRowClick = (id: string) => {
router.push(`/${entity}/${id}`);
};
return (
-
-
-
- {title}
-
-
-
- onRowClick(row.id)}
- />
-
-
-
-
+
);
};
diff --git a/apps/bridge-frontend/app/_components/Login.tsx b/apps/bridge-frontend/app/_components/Login.tsx
new file mode 100644
index 0000000..22b70e2
--- /dev/null
+++ b/apps/bridge-frontend/app/_components/Login.tsx
@@ -0,0 +1,184 @@
+"use client";
+
+import { FC, useState } from "react";
+import {
+ Box,
+ Grid,
+ Container,
+ IconButton,
+ Typography,
+ TextField,
+} from "@mui/material";
+import {
+ Apple as AppleIcon,
+ Google as GoogleIcon,
+ Key as KeyIcon,
+} from "@mui/icons-material";
+import { signIn } from "next-auth/react";
+import Image from "next/image";
+import LinkLogo from "@/app/../public/link-logo-small.png";
+import { colors } from "@/app/_styles/theme";
+import { useSearchParams } from "next/navigation";
+
+type LoginProps = {
+ session: any;
+};
+
+export const Login: FC = ({ session }) => {
+ const origin =
+ typeof window !== "undefined" && window.location.origin
+ ? window.location.origin
+ : "";
+ const [email, setEmail] = useState("");
+ const [password, setPassword] = useState("");
+ const params = useSearchParams();
+ const error = params.get("error");
+ const { darkGray, cdrLinkOrange, white } = colors;
+ const buttonStyles = {
+ borderRadius: 500,
+ width: "100%",
+ fontSize: "16px",
+ fontWeight: "bold",
+ backgroundColor: white,
+ "&:hover": {
+ color: white,
+ backgroundColor: cdrLinkOrange,
+ },
+ };
+ const fieldStyles = {
+ "& label.Mui-focused": {
+ color: cdrLinkOrange,
+ },
+ "& .MuiInput-underline:after": {
+ borderBottomColor: cdrLinkOrange,
+ },
+ "& .MuiFilledInput-underline:after": {
+ borderBottomColor: cdrLinkOrange,
+ },
+ "& .MuiOutlinedInput-root": {
+ "&.Mui-focused fieldset": {
+ borderColor: cdrLinkOrange,
+ },
+ },
+ };
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+ CDR Bridge
+
+
+
+
+
+ {!session ? (
+
+
+ {error ? (
+
+
+
+ {`${error} error`}
+
+
+
+ ) : null}
+
+
+ signIn("google", {
+ callbackUrl: `${origin}`,
+ })
+ }
+ >
+
+ Sign in with Google
+
+
+
+
+ signIn("apple", {
+ callbackUrl: `${window.location.origin}`,
+ })
+ }
+ >
+
+ Sign in with Apple
+
+
+
+
+ ) : null}
+ {session ? (
+
+ {` ${session.user.name ?? session.user.email}.`}
+
+ ) : null}
+
+
+
+
+ );
+};
diff --git a/apps/bridge-frontend/app/_components/Sidebar.tsx b/apps/bridge-frontend/app/_components/Sidebar.tsx
index 645c386..7c14923 100644
--- a/apps/bridge-frontend/app/_components/Sidebar.tsx
+++ b/apps/bridge-frontend/app/_components/Sidebar.tsx
@@ -19,6 +19,7 @@ import {
PermPhoneMsg as PhoneIcon,
WhatsApp as WhatsAppIcon,
Facebook as FacebookIcon,
+ AirlineStops as AirlineStopsIcon,
} from "@mui/icons-material";
import { usePathname } from "next/navigation";
import Link from "next/link";
@@ -28,7 +29,7 @@ import LinkLogo from "@/public/link-logo-small.png";
// import { useSession, signOut } from "next-auth/react";
const openWidth = 270;
-const closedWidth = 100;
+const closedWidth = 70;
const MenuItem = ({
name,
@@ -180,7 +181,7 @@ export const Sidebar: FC = ({ open, setOpen }) => {
= ({ open, setOpen }) => {
>
= ({ open, setOpen }) => {
}}
>