Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
6d29cc7
datasources
cyri113 Apr 11, 2025
d7e4139
Applications
cyri113 Apr 11, 2025
e0ed5d8
home layout
cyri113 Apr 11, 2025
49b9bf9
minor improvements
cyri113 Apr 12, 2025
f61e694
module and platform view on home
cyri113 Apr 14, 2025
cdeb255
lint fix
cyri113 Apr 14, 2025
bdbc178
fix typescript version
cyri113 Apr 15, 2025
3b68136
Fix searchParams
cyri113 Apr 15, 2025
b67ff9c
Fix TcDiscordIntgration
cyri113 Apr 15, 2025
276f863
TcDiscourse
cyri113 Apr 15, 2025
a2a43c1
Fix addPlatform
cyri113 Apr 15, 2025
f17b9ef
Fix searchParams.get
cyri113 Apr 15, 2025
5c1a90a
tooltip text size
cyri113 Apr 15, 2025
21e18d4
Update module names
cyri113 Apr 15, 2025
6af39b2
whole lot of updates
cyri113 Apr 16, 2025
f81e775
fix div
cyri113 Apr 16, 2025
cc5b55c
lint:fix
cyri113 Apr 16, 2025
0fc9633
center login
cyri113 Apr 16, 2025
2a149ab
test out api path for p2p
cyri113 Apr 22, 2025
5742dca
MediaWiki Form
cyri113 Apr 30, 2025
ff1ddbb
CRUD MediaWiki + Breadcrumbs
cyri113 Apr 30, 2025
23902c2
Lint
cyri113 Apr 30, 2025
1edfeea
Improve Mediawiki form
cyri113 May 13, 2025
f144bfb
Update Mediawiki module form
cyri113 May 13, 2025
dd71d3c
Message on TCMediaWiki
cyri113 May 13, 2025
d841147
update settings
cyri113 May 13, 2025
587b08f
small fixes to platform view
cyri113 May 13, 2025
fa776f8
add export const runtime = 'edge'
cyri113 May 13, 2025
1d49e90
add _not-found page
cyri113 May 13, 2025
be8f266
move not found to folder
cyri113 May 13, 2025
e1258c8
move to not-found.tsx
cyri113 May 13, 2025
5a4080a
troubleshooting.
cyri113 May 13, 2025
ab60457
added app/error.tsx
cyri113 May 13, 2025
67af038
modified pages/_error.tsx
cyri113 May 13, 2025
0748710
revert _error.tsx
cyri113 May 13, 2025
4ab6c20
update app/error.tsx
cyri113 May 13, 2025
c4a48bf
added next.config.cloudflare.js
cyri113 May 13, 2025
bb25d2e
modify _error.tsx
cyri113 May 13, 2025
532e1be
remove error
cyri113 May 13, 2025
5fbade1
added app/error.tsx
cyri113 May 13, 2025
f9fcd77
make distDir = out
cyri113 May 13, 2025
8426666
update next.config.js
cyri113 May 13, 2025
d1ab37b
attempt at fix
cyri113 May 13, 2025
a405478
test new build
cyri113 May 14, 2025
894e1d0
remove unused libs
cyri113 May 14, 2025
1152b84
build worked on local
cyri113 May 15, 2025
8053091
use npm
cyri113 May 15, 2025
9421003
comment setDevPlatform
cyri113 May 15, 2025
ad4944d
module.exports
cyri113 May 15, 2025
3fede2d
.gitignore .wrangler
cyri113 May 16, 2025
26f17ea
log project id.
cyri113 May 16, 2025
45dbe1b
log conf
cyri113 May 16, 2025
0780b83
remove edge runtime
cyri113 May 16, 2025
5dbc24f
add edge to mediawiki show and edit
cyri113 May 16, 2025
8f65689
remove breadcrumbs from MW /new
cyri113 May 19, 2025
5114387
fix for no namespace
cyri113 May 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ yarn-error.log*
next-env.d.ts

.env
.wrangler
32 changes: 27 additions & 5 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,35 @@
/** @type {import('next').NextConfig} */
// import { setupDevPlatform } from '@cloudflare/next-on-pages/next-dev';

/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
reactStrictMode: false,
swcMinify: true,
trailingSlash: true,
images: {
unoptimized: true,
},
};
}

// if (process.env.NODE_ENV === 'development') {
// setupDevPlatform(nextConfig);
// }

// export default nextConfig;

// module.exports = nextConfig;

// const withBundleAnalyzer = require('@next/bundle-analyzer')({
// enabled: process.env.ANALYZE === 'true',
// })

// const nextConfig = withBundleAnalyzer({
// // distDir: 'out',
// output: 'export',
// reactStrictMode: false,
// swcMinify: true,
// trailingSlash: true,
// images: {
// unoptimized: true,
// },
// })

module.exports = nextConfig;
module.exports = nextConfig;
29,991 changes: 17,782 additions & 12,209 deletions package-lock.json

Large diffs are not rendered by default.

26 changes: 12 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,17 @@
"lint:strict": "eslint --max-warnings=0 src",
"test": "jest",
"coverage": "jest --coverage",
"export": "next export",
"format": "prettier --check --ignore-path .gitignore .",
"format:fix": "prettier --write --ignore-path .gitignore ."
"format:fix": "prettier --write --ignore-path .gitignore .",
"pages:build": "npx @cloudflare/next-on-pages",
"preview": "npm run pages:build && wrangler pages dev",
"deploy": "npm run pages:build && wrangler pages deploy"
},
"dependencies": {
"@amplitude/analytics-browser": "^1.9.4",
"@date-io/date-fns": "^2.17.0",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@fortawesome/fontawesome-svg-core": "^6.2.0",
"@fortawesome/free-brands-svg-icons": "^6.2.0",
"@fortawesome/free-regular-svg-icons": "^6.2.0",
"@fortawesome/free-solid-svg-icons": "^6.2.0",
"@fortawesome/react-fontawesome": "^0.2.0",
"@hassanmojab/react-modern-calendar-datepicker": "^3.1.7",
"@mui/lab": "^5.0.0-alpha.121",
"@mui/material": "^5.11.6",
"@mui/x-date-pickers": "^6.18.6",
Expand All @@ -36,8 +32,6 @@
"@types/node": "18.11.9",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"3d-force-graph-vr": "^2.2.2",
"aframe": "^1.4.2",
"axios": "^1.2.2",
"clsx": "^1.2.1",
"d3-force": "^3.0.0",
Expand All @@ -48,6 +42,7 @@
"eslint-plugin-react": "^7.32.0",
"highcharts": "^11.4.1",
"highcharts-react-official": "^3.2.1",
"jotai": "^2.12.3",
"jwt-decode": "^3.1.2",
"lodash": "^4.17.21",
"moment": "^2.29.4",
Expand All @@ -58,23 +53,25 @@
"papaparse": "^5.4.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-force-graph": "^1.43.0",
"react-force-graph-2d": "^1.25.0",
"react-helmet-async": "^1.3.0",
"react-hook-form": "^7.55.0",
"react-hotjar": "^5.5.0",
"react-icons": "^4.11.0",
"react-modern-calendar-datepicker": "^3.1.6",
"react-router-dom": "^6.4.3",
"react-timezone-select": "^1.3.2",
"react-toastify": "^9.1.1",
"sharp": "^0.33.5",
"timezones-list": "^3.0.1",
"typescript": "^5.6.3",
"typescript": "^5.6.0",
"viem": "^2.21.40",
"wagmi": "^2.12.25",
"zustand": "^4.3.1"
},
"devDependencies": {
"@cloudflare/next-on-pages": "^1.13.12",
"@next/bundle-analyzer": "^15.3.2",
"@tailwindcss/typography": "^0.5.16",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.5.1",
Expand All @@ -86,6 +83,7 @@
"@typescript-eslint/parser": "^7.0.2",
"autoprefixer": "^10.4.13",
"babel-jest": "^29.5.0",
"daisyui": "4.12.24",
"eslint": "^8.56.0",
"eslint-plugin-simple-import-sort": "^12.0.0",
"eslint-plugin-unused-imports": "^3.1.0",
Expand All @@ -98,4 +96,4 @@
"react-test-renderer": "^18.2.0",
"tailwindcss": "^3.2.2"
}
}
}
16 changes: 6 additions & 10 deletions src/pages/agent/index.tsx → src/app/dashboard/agent/page.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { FaRobot } from "react-icons/fa";
'use client';

import { FaRobot } from "react-icons/fa6";

import { Chat } from "@/components/chat/Chat";
import SEO from "@/components/global/SEO";

import { defaultLayout } from "@/layouts/defaultLayout";

function Index() {
export default function AgentPage() {
return (
<>
<SEO titleTemplate="Agent" />
<div className="flex flex-col gap-4 bg-gray-100 w-full h-screen p-8">
<div className="flex flex-col gap-4 bg-gray-100 w-full p-8 overflow-y-auto">
<div className="flex flex-col gap-4">
<h1 className="text-3xl font-bold text-center flex items-center justify-center gap-2">
<FaRobot className="inline-block mr-2" />
Expand All @@ -21,8 +21,4 @@ function Index() {
</div >
</>
);
}

Index.pageLayout = defaultLayout;

export default Index;
}
62 changes: 62 additions & 0 deletions src/app/dashboard/community-guardian/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
'use client'

import { useRouter } from "next/navigation"
import { FaDiscord, FaTelegram } from "react-icons/fa"
import { FaXTwitter } from "react-icons/fa6"

import { MODULE_CONTEXT } from "@/constants/ModuleContext"

export default function CommunityGuardianPage() {
const router = useRouter()

// TODO: rename to community-guardian
const data = MODULE_CONTEXT.find(module => module.name === 'violationDetection')
Comment on lines +12 to +13
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Address the TODO comment about renaming.

There's a TODO comment about renaming to 'community-guardian'. Since this file is already in the community-guardian directory, this might be referring to the module name in ModuleContext.ts.


🏁 Script executed:

#!/bin/bash
# Check the module name in ModuleContext.ts
rg "violationDetection" src/constants/ModuleContext.ts -A 5 -B 1

Length of output: 460


🏁 Script executed:

#!/bin/bash
# Display the ModuleContext.ts to review naming conventions
sed -n '1,200p' src/constants/ModuleContext.ts

Length of output: 2860


Update the Community Guardian module identifier and remove the TODO

The module’s internal name and configPath still use “violationDetection,” but your new directory and URLs are “community-guardian.” You’ll need to update both the module context and the lookup in your page.

• In src/constants/ModuleContext.ts:

  • Change
    name: "violationDetection",
    configPath: '/community-settings/violation-detection',
    to
    name: "communityGuardian",
    configPath: '/community-settings/community-guardian',

• In src/app/dashboard/community-guardian/page.tsx:

  • Replace
    // TODO: rename to community-guardian
    const data = MODULE_CONTEXT.find(module => module.name === 'violationDetection')
    with
    const data = MODULE_CONTEXT.find(module => module.name === 'communityGuardian')

Once these changes are applied, you can remove the TODO comment.


if (!data || data === undefined) {
router.push('/dashboard')
}
Comment on lines +15 to +17
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve redirect logic to handle async navigation.

The component immediately redirects if data is not found, but doesn't handle the loading state during redirect. Consider adding a return statement after the redirect to prevent rendering the rest of the component.

if (!data || data === undefined) {
  router.push('/dashboard')
+  return null; // Prevent rendering the rest of the component during redirect
}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (!data || data === undefined) {
router.push('/dashboard')
}
if (!data || data === undefined) {
router.push('/dashboard')
return null; // Prevent rendering the rest of the component during redirect
}


return (
<div className="flex flex-col gap-4">
<div className="flex items-center gap-2">
{data && <data.icon size={24} className="text-secondary" />}
<h1 className="text-2xl font-semibold">{data?.title}</h1>
</div>
<p className="text-md text-gray-400">
Neutral, AI-powered Code of Conduct enforcement for safer, healthier communities.
</p>

<div className="flex flex-col gap-4 w-full md:w-1/2">

<p className="text-sm leading-relaxed">Community Guardian helps maintain respectful and inclusive conversations by detecting potential Code of Conduct violations and flagging them early.</p>

<p className="text-sm leading-relaxed">This module is currently in beta and access is limited.</p>

<p className="text-sm leading-relaxed">We're working with selected communities to fine-tune detection, alerts, and recommendations. If you're interested in early access or want to learn more, reach out to us on:</p>

<ul className="flex flex-col gap-2 text-sm">
<li className="w-fit">
<a href="https://discord.gg/QNJGeZeT" target="_blank" className="text-blue-500 hover:text-blue-600 hover:underline flex items-center gap-2" rel="noreferrer">
<FaDiscord />
<span>Discord</span>
</a>
</li>
<li className="w-fit">
<a href="https://x.com/together_crew" target="_blank" className="text-blue-500 hover:text-blue-600 hover:underline flex items-center gap-2" rel="noreferrer">
<FaXTwitter />
<span>Twitter</span>
</a>
</li>
<li className="w-fit">
<a href="https://t.me/k_bc0" target="_blank" className="text-blue-500 hover:text-blue-600 hover:underline flex items-center gap-2" rel="noreferrer">
<FaTelegram />
<span>Telegram</span>
</a>
</li>
</ul>

</div>
</div >

)
}
28 changes: 28 additions & 0 deletions src/app/dashboard/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"use client";

import { QueryClient, QueryClientProvider } from "@tanstack/react-query";

import ProtectedRoute from "@/components/auth/ProtectedRoute";
import Breadcrumbs from "@/components/layouts/Breadcrumbs";
import DashboardLayout from "@/components/layouts/DashboardLayout";

import { TokenProvider } from "@/context/TokenContext";

const queryClient = new QueryClient();

export default function RootLayout({ children }: { children: React.ReactNode }) {


return (
<ProtectedRoute>
<QueryClientProvider client={queryClient}>
<TokenProvider>
<DashboardLayout>
<Breadcrumbs />
{children}
</DashboardLayout>
</TokenProvider>
</QueryClientProvider>
</ProtectedRoute>
)
}
32 changes: 32 additions & 0 deletions src/app/dashboard/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
'use client';

import { FaHome } from "react-icons/fa";

import SEO from "@/components/global/SEO";
import ModuleList from "@/components/home/modules/ModuleList";
import PlatformList from "@/components/home/platforms/PlatformList";

export default function Page() {

return (
<>
<SEO title="Home" />
<div className="flex flex-col gap-6 sm:gap-8">
<h1 className="text-2xl font-semibold flex items-center gap-2">
<FaHome className="text-secondary" />
<span>Dashboard</span>
</h1>
{/* <OnlyAdminWarning /> */}
<div className="flex flex-col md:flex-row gap-6 md:gap-8">
<div className="flex-1">
<PlatformList />
</div>
<div className="flex-1">
<ModuleList />
</div>
</div >
</div>

</ >
);
}
Comment on lines +9 to +32
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Well-structured dashboard page with responsive layout.

The dashboard page is well-structured with semantic HTML and responsive design using Tailwind's responsive prefixes. The layout adapts from a single column on mobile to two columns on medium and larger screens.

Consider whether the commented-out <OnlyAdminWarning /> component on line 19 is needed or can be removed to keep the codebase clean.


🏁 Script executed:

#!/bin/bash
# Check if OnlyAdminWarning is used elsewhere in the codebase
rg -l "OnlyAdminWarning" --type tsx --type jsx

Length of output: 74


🏁 Script executed:

#!/bin/bash
# Retry searching for OnlyAdminWarning without relying on tsx/jsx type definitions
rg -l "OnlyAdminWarning" --glob '*.tsx' --glob '*.jsx'

Length of output: 81


🏁 Script executed:

#!/bin/bash
# Show import statements and early code of page.tsx to check for OnlyAdminWarning import
sed -n '1,20p' src/app/dashboard/page.tsx

Length of output: 677


Clean up unused commented code

The OnlyAdminWarning component is neither imported nor used elsewhere in the codebase. You can safely remove the commented-out line to keep the code clean.

• Remove the commented line in src/app/dashboard/page.tsx (around line 19):

-        {/* <OnlyAdminWarning /> */}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export default function Page() {
return (
<>
<SEO title="Home" />
<div className="flex flex-col gap-6 sm:gap-8">
<h1 className="text-2xl font-semibold flex items-center gap-2">
<FaHome className="text-secondary" />
<span>Dashboard</span>
</h1>
{/* <OnlyAdminWarning /> */}
<div className="flex flex-col md:flex-row gap-6 md:gap-8">
<div className="flex-1">
<PlatformList />
</div>
<div className="flex-1">
<ModuleList />
</div>
</div >
</div>
</ >
);
}
export default function Page() {
return (
<>
<SEO title="Home" />
<div className="flex flex-col gap-6 sm:gap-8">
<h1 className="text-2xl font-semibold flex items-center gap-2">
<FaHome className="text-secondary" />
<span>Dashboard</span>
</h1>
<div className="flex flex-col md:flex-row gap-6 md:gap-8">
<div className="flex-1">
<PlatformList />
</div>
<div className="flex-1">
<ModuleList />
</div>
</div >
</div>
</ >
);
}

6 changes: 6 additions & 0 deletions src/app/dashboard/settings/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// src/app/dashboard/settings/layout.tsx
'use client'

export default function SettingsLayout({ children }: { children: React.ReactNode }) {
return children
}
32 changes: 32 additions & 0 deletions src/app/dashboard/settings/mediawiki/[id]/edit/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
'use client'

export const runtime = 'edge';

import { useQuery } from "@tanstack/react-query";
import { useParams } from "next/navigation";

import MediaWikiForm from "@/components/mediawiki/Form";

import { axiosInstance } from "@/axiosInstance";
import { IPlatformProps } from "@/utils/interfaces";

export default function MediaWikiEditPage() {
const params = useParams();
const id = params?.id as string;

const { data } = useQuery({
queryKey: ["platform", id],
queryFn: () => axiosInstance.get(`/platforms/${id}`),
})
Comment on lines +16 to +20
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add error handling for the query.

Your query implementation doesn't handle errors. If the API request fails, users won't see any feedback.

-  const { data } = useQuery({
+  const { data, isLoading, error } = useQuery({
     queryKey: ["platform", id],
     queryFn: () => axiosInstance.get(`/platforms/${id}`),
   })
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const { data } = useQuery({
queryKey: ["platform", id],
queryFn: () => axiosInstance.get(`/platforms/${id}`),
})
const { data, isLoading, error } = useQuery({
queryKey: ["platform", id],
queryFn: () => axiosInstance.get(`/platforms/${id}`),
})


return (
<div className="flex flex-col gap-4">
<div className="flex justify-between">
<h1 className="text-2xl font-bold">Edit MediaWiki</h1>
</div>
<div className="bg-base-100 p-8 rounded-lg">
{data && <MediaWikiForm edit={data.data as unknown as IPlatformProps} />}
</div>
</div>
);
Comment on lines +22 to +31
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add loading and error states to improve user experience.

The component doesn't show loading or error states while fetching data.

   return (
     <div className="flex flex-col gap-4">
       <div className="flex justify-between">
         <h1 className="text-2xl font-bold">Edit MediaWiki</h1>
       </div>
       <div className="bg-base-100 p-8 rounded-lg">
-        {data && <MediaWikiForm edit={data.data as unknown as IPlatformProps} />}
+        {isLoading ? (
+          <div className="flex justify-center p-4">
+            <span className="loading loading-spinner loading-md"></span>
+          </div>
+        ) : error ? (
+          <div className="alert alert-error">
+            <span>Failed to load platform data. Please try again.</span>
+          </div>
+        ) : data && (
+          <MediaWikiForm edit={data.data as unknown as IPlatformProps} />
+        )}
       </div>
     </div>
   );
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return (
<div className="flex flex-col gap-4">
<div className="flex justify-between">
<h1 className="text-2xl font-bold">Edit MediaWiki</h1>
</div>
<div className="bg-base-100 p-8 rounded-lg">
{data && <MediaWikiForm edit={data.data as unknown as IPlatformProps} />}
</div>
</div>
);
return (
<div className="flex flex-col gap-4">
<div className="flex justify-between">
<h1 className="text-2xl font-bold">Edit MediaWiki</h1>
</div>
<div className="bg-base-100 p-8 rounded-lg">
{isLoading ? (
<div className="flex justify-center p-4">
<span className="loading loading-spinner loading-md"></span>
</div>
) : error ? (
<div className="alert alert-error">
<span>Failed to load platform data. Please try again.</span>
</div>
) : data && (
<MediaWikiForm edit={data.data as unknown as IPlatformProps} />
)}
</div>
</div>
);

}
29 changes: 29 additions & 0 deletions src/app/dashboard/settings/mediawiki/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
'use client'

export const runtime = 'edge';

import { useQuery } from "@tanstack/react-query";
import { useParams } from "next/navigation";

import { axiosInstance } from "@/axiosInstance";

export default function MediaWikiPage() {
const params = useParams();
const id = params?.id as string;

const { data } = useQuery({
queryKey: ["platform", id],
queryFn: () => axiosInstance.get(`/platforms/${id}`),
})
Comment on lines +14 to +17
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Missing error and loading states for query

The component doesn't handle loading or error states from the React Query hook, which could lead to a poor user experience if the API request fails or takes time to load.

Consider adding error and loading states:

- const { data } = useQuery({
+ const { data, isLoading, error } = useQuery({
  queryKey: ["platform", id],
  queryFn: () => axiosInstance.get(`/platforms/${id}`),
})

// Then in the return statement:
<div className="bg-base-100 p-8 rounded-lg">
+  {isLoading && <p>Loading...</p>}
+  {error && <p className="text-error">Error loading platform details</p>}
+  {data?.data && (
+    // Display data here
+  )}
</div>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const { data } = useQuery({
queryKey: ["platform", id],
queryFn: () => axiosInstance.get(`/platforms/${id}`),
})
// Before:
- const { data } = useQuery({
+ const { data, isLoading, error } = useQuery({
queryKey: ["platform", id],
queryFn: () => axiosInstance.get(`/platforms/${id}`),
})
return (
<div className="bg-base-100 p-8 rounded-lg">
+ {isLoading && <p>Loading...</p>}
+ {error && <p className="text-error">Error loading platform details</p>}
+ {data?.data && (
+ // Display data here
+ )}
</div>
)


return (
<div className="flex flex-col gap-4">
<div className="flex justify-between">
<h1 className="text-2xl font-bold">MediaWiki</h1>
</div>
<div className="bg-base-100 p-8 rounded-lg">

</div>
</div>
)
}
16 changes: 16 additions & 0 deletions src/app/dashboard/settings/mediawiki/new/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use client'

import MediaWikiForm from "@/components/mediawiki/Form";

export default function MediaWikiNewPage() {
return (
<div className="flex flex-col gap-4">
<div className="flex justify-between">
<h1 className="text-2xl font-bold">New MediaWiki</h1>
</div>
<div className="bg-base-100 p-8 rounded-lg">
<MediaWikiForm />
</div>
</div>
);
}
Loading