diff --git a/frontend/package-lock.json b/frontend/package-lock.json
index 3a21fe2..8ccf950 100644
--- a/frontend/package-lock.json
+++ b/frontend/package-lock.json
@@ -11,13 +11,16 @@
"@headlessui/react": "^1.7.19",
"@heroicons/react": "^2.2.0",
"axios": "^1.7.7",
+ "class-variance-authority": "^0.7.1",
+ "clsx": "^2.1.1",
"date-fns": "^4.1.0",
"framer-motion": "^11.18.2",
"jwt-decode": "^4.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^5.5.0",
- "react-router-dom": "^6.15.0"
+ "react-router-dom": "^6.15.0",
+ "tailwind-merge": "^3.0.2"
},
"devDependencies": {
"@types/react": "^18.2.15",
@@ -1416,11 +1419,32 @@
"node": ">= 6"
}
},
+ "node_modules/class-variance-authority": {
+ "version": "0.7.1",
+ "resolved": "https://registry.npmjs.org/class-variance-authority/-/class-variance-authority-0.7.1.tgz",
+ "integrity": "sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "clsx": "^2.1.1"
+ },
+ "funding": {
+ "url": "https://polar.sh/cva"
+ }
+ },
"node_modules/client-only": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz",
"integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA=="
},
+ "node_modules/clsx": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz",
+ "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
@@ -4100,6 +4124,16 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/tailwind-merge": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.0.2.tgz",
+ "integrity": "sha512-l7z+OYZ7mu3DTqrL88RiKrKIqO3NcpEO8V/Od04bNpvk0kiIFndGEoqfuzvj4yuhRkHKjRkII2z+KS2HfPcSxw==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/dcastil"
+ }
+ },
"node_modules/tailwindcss": {
"version": "3.4.14",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.14.tgz",
diff --git a/frontend/package.json b/frontend/package.json
index 1c101ba..f0c8abf 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -13,13 +13,16 @@
"@headlessui/react": "^1.7.19",
"@heroicons/react": "^2.2.0",
"axios": "^1.7.7",
+ "class-variance-authority": "^0.7.1",
+ "clsx": "^2.1.1",
"date-fns": "^4.1.0",
"framer-motion": "^11.18.2",
"jwt-decode": "^4.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^5.5.0",
- "react-router-dom": "^6.15.0"
+ "react-router-dom": "^6.15.0",
+ "tailwind-merge": "^3.0.2"
},
"devDependencies": {
"@types/react": "^18.2.15",
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx
index 39c4a86..6c667b2 100644
--- a/frontend/src/App.jsx
+++ b/frontend/src/App.jsx
@@ -1,6 +1,5 @@
// import './App.css'
import { AuthProvider } from './hooks/useAuth';
-import Navbar from './components/navbar/Navbar'
import { BrowserRouter, Routes, Route } from "react-router-dom";
import Home from './pages/homepage/Home'
import About from './pages/aboutpage/About'
@@ -14,45 +13,50 @@ import Certificates from './components/Certificates/Certificates.jsx';
import Clients from './components/clients/clients';
import AdminPanel from './components/adminPanel/AdminPanel';
import Dashboard from './components/dashboard/Dashboard';
-import Login from './components/login/login';
+import Login from './components/login/Login';
+import Navbar from './components/navbar/Navbar';
import ProtectedRoute from './components/protectedRoute/ProtectedRoute';
+import { ThemeProvider } from './theme/ThemeProvider';
+// import { Navbar } from './components/navbar/Navbar';
function App() {
return (
+ {error} +
+ )} ++ {children} +
+ ); +} \ No newline at end of file diff --git a/frontend/src/components/UI/Table.jsx b/frontend/src/components/UI/Table.jsx new file mode 100644 index 0000000..80940de --- /dev/null +++ b/frontend/src/components/UI/Table.jsx @@ -0,0 +1,88 @@ +import React from 'react'; +import { cn } from '../../utils/cn'; + +export function Table({ className, children, ...props }) { + return ( +Manage users and documents
+Manage users and documents
| Title | -Status | -Uploaded By | -Shared With | -Created At | +|||
|---|---|---|---|---|---|---|---|
| Title | +Status | +Uploaded By | +Shared With | +Created At | |||
| {doc.title} | +|||||||
| {doc.title} | {doc.status} | -+ | {doc.uploadedBy?.name} ({doc.uploadedBy?.email}) | -+ |
{doc.sharedWith && doc.sharedWith.length > 0
? doc.sharedWith.map(user => (
@@ -172,7 +172,7 @@ function AdminPanel() {
))
: 'None'}
|
- + | {new Date(doc.createdAt).toLocaleString()} |
| Name | -Role | +|
|---|---|---|
| Name | +Role | |
| {user.name} | -{user.email} | +|
| {user.name} | +{user.email} | + ${user.isAdmin ? 'bg-primary-500/20 text-primary-300' : 'bg-neutral-500/20 text-neutral-300'}`}> {user.isAdmin ? 'Admin' : 'User'} | @@ -261,7 +270,7 @@ function AdminPanel() { )} {activeTab === 'upload' && ( -