8000 more features to admin dashboard · codeonym/unilab-frontend@6c9d94f · GitHub
[go: up one dir, main page]

Skip to content

Commit 6c9d94f

Browse files
more features to admin dashboard
1 parent ea8d28a commit 6c9d94f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1686
-130
lines changed

app/actions/consumablesActions.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,13 @@ export const updateConsumableAction = async (formData) => {
1515
await new Promise((resolve) => setTimeout(resolve, 3000));
1616

1717
return { ok: true, message: "Consumable updated successfully" };
18+
}
19+
20+
21+
export const deleteConsumableAction = async (id) => {
22+
23+
console.log(id);
24+
await new Promise((resolve) => setTimeout(resolve, 2000));
25+
26+
return { ok: true, message: "Consumable deleted successfully" };
1827
}

app/actions/materialsActions.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,13 @@ export const updateMaterialAction = async (formData) => {
1515
await new Promise((resolve) => setTimeout(resolve, 3000));
1616

1717
return { ok: true, message: "Material updated successfully" };
18+
}
19+
20+
21+
export const deleteMaterialAction = async (id) => {
22+
23+
console.log(id);
24+
await new Promise((resolve) => setTimeout(resolve, 2000));
25+
26+
return { ok: true, message: "Material deleted successfully" };
1827
}

app/actions/rubricsActions.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,13 @@ export const updateRubricAction = async (formData) => {
1515
await new Promise((resolve) => setTimeout(resolve, 3000));
1616

1717
return { ok: true, message: "Rubric updated successfully" };
18+
}
19+
20+
21+
export const deleteRubricAction = async (id) => {
22+
23+
console.log(id);
24+
await new Promise((resolve) => setTimeout(resolve, 2000));
25+
26+
return { ok: true, message: "Rubric deleted successfully" };
1827
}

app/actions/suppliersActions.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,13 @@ export const updateSupplierAction = async (formData) => {
1515
await new Promise((resolve) => setTimeout(resolve, 3000));
1616

1717
return { ok: true, message: "Supplier updated successfully" };
18+
}
19+
20+
21+
export const deleteSupplierAction = async (i F438 d) => {
22+
23+
console.log(id);
24+
await new Promise((resolve) => setTimeout(resolve, 2000));
25+
26+
return { ok: true, message: "Supplier deleted successfully" };
1827
}

app/actions/usersActions.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,13 @@ export const updateUserAction = async (formData) => {
1515
await new Promise((resolve) => setTimeout(resolve, 3000));
1616

1717
return { ok: true, message: "User updated successfully" };
18+
}
19+
20+
21+
export const deleteUserAction = async (id) => {
22+
23+
console.log(id);
24+
await new Promise((resolve) => setTimeout(resolve, 2000));
25+
26+
return { ok: true, message: "User deleted successfully" };
1827
}

app/components/ui/BackwardButton.jsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"use client"
2+
import { useRouter } from 'next/navigation'
3+
import { cn } from "@lib/utils"
4+
function BackwardButton({ children, className }) {
5+
const router = useRouter();
6+
return (
7+
<div
8+
className={cn('cn', className)}
9+
onClick={() => router.back()}
10+
>
11+
{children}
12+
</div>
13+
)
14+
}
15+
16+
export default BackwardButton

app/components/ui/DataActions.jsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"use client"
2+
import React from 'react'
3+
import Link from 'next/link'
4+
import { PiNotePencilFill } from "react-icons/pi";
5+
import { MdDelete } from "react-icons/md";
6+
import { usePathname } from 'next/navigation';
7+
8+
function DataActions() {
9+
const path = usePathname()
10+
return (
11+
<div
12+
className="
13+
flex items-center gap-2
14+
"
15+
>
16+
<Link
17+
href={`${path}/update`}
18+
className="btn bg-blue-400 btn-sm text-white"
19+
>
20+
<PiNotePencilFill />
21+
</Link>
22+
<Link
23+
href={`${path}/delete`}
24+
className="btn bg-rose-400 btn-sm text-white"
25+
>
26+
<MdDelete />
27+
</Link>
28+
</div>
29+
)
30+
}
31+
32+
export default DataActions

app/components/ui/DataAddress.jsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import React from 'react'< 10000 /div>
2+
import { FaLocationDot } from "react-icons/fa6";
3+
4+
function DataAddress({ title, value }) {
5+
return (
6+
<div
7+
className='flex flex-col gap-2 w-72 sm:w-80 p-4 shadow shadow-base-300'
8+
>
9+
<span
10+
className='font-bold'
11+
>
12+
{title}
13+
</span>
14+
<div
15+
className='flex items-center gap-4 '
16+
>
17+
<FaLocationDot />
18+
<div
19+
className='p-4 whitespace-nowrap opacity-70 w-full overflow-x-scroll scrollbar-thin scrollbar-track-base-200 scrollbar-thumb-base-300 bg-base-200 rounded-md'
20+
>
21+
{value}
22+
</div>
23+
</div>
24+
</div>
25+
)
26+
}
27+
28+
export default DataAddress

app/components/ui/DataAvatar.jsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { cn, capitalize } from "@lib/utils"
2+
function DataAvatar({className, fontSize, ancName}) {
3+
return (
4+
<div className="avatar placeholder">
5+
<div className={cn('bg-neutral text-neutral-content rounded-full ring ring-primary ring-offset-base-100 ring-offset-2 w-24', className)}>
6+
<span className={cn("text-xl" ,fontSize) }>
7+
{capitalize(ancName)}
8+
</span>
9+
</div>
10+
</div>
11+
)
12+
}
13+
14+
export default DataAvatar

app/components/ui/DataBank.jsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { BsBank2 } from "react-icons/bs"
2+
3+
function DataDate({ title, value }) {
4+
return (
5+
<div
6+
className='flex flex-col gap-2 w-72 sm:w-80 p-4 shadow shadow-base-300'
7+
>
8+
<span
9+
className='font-bold'
10+
>
11+
{title}
12+
</span>
13+
<div
14+
className='flex items-center gap-4 '
15+
>
16+
<BsBank2 />
17+
<div
18+
className='p-4 whitespace-nowrap opacity-70 w-full overflow-x-scroll scrollbar-thin scrollbar-track-base-200 scrollbar-thumb-base-300 bg-base-200 rounded-md'
19+
>
20+
{value}
21+
</div>
22+
</div>
23+
</div>
24+
)
25+
}
26+
27+
export default DataDate

app/components/ui/DataConsumption.jsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import React from 'react'
2+
import { FaDatabase } from "react-icons/fa6"
3+
import ConsummationBar from '@dashboard/@admin/components/ConsummationBar';
4+
5+
function DataAddress({ title, value, max }) {
6+
return (
7+
<div
8+
className='flex flex-col gap-2 w-72 sm:w-80 p-4 shadow shadow-base-300'
9+
>
10+
<span
11+
className='font-bold'
12+
>
13+
{title}
14+
</span>
15+
<div
16+
className='flex items-center gap-4 '
17+
>
18+
<FaDatabase />
19+
<div
20+
className='p-4 whitespace-nowrap opacity-70 w-full overflow-x-scroll scrollbar-thin scrollbar-track-base-200 scrollbar-thumb-base-300 bg-base-200 rounded-md'
21+
>
22+
<ConsummationBar
23+
value={value}
24+
max={max}
25+
/>
26+
</div>
27+
</div>
28+
</div>
29+
)
30+
}
31+
32+
export default DataAddress

app/components/ui/DataDate.jsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { IoCalendarNumber } from "react-icons/io5";
2+
3+
function DataDate({ title, value }) {
4+
return (
5+
<div
6+
className='flex flex-col gap-2 w-72 sm:w-80 p-4 shadow shadow-base-300'
7+
>
8+
<span
9+
className='font-bold'
10+
>
11+
{title}
12+
</span>
13+
<div
14+
className='flex items-center gap-4 '
15+
>
16+
<IoCalendarNumber />
17+
<div
18+
className='p-4 whitespace-nowrap opacity-70 w-full overflow-x-scroll scrollbar-thin scrollbar-track-base-200 scrollbar-thumb-base-300 bg-base-200 rounded-md'
19+
>
20+
{value}
21+
</div>
22+
</div>
23+
</div>
24+
)
25+
}
26+
27+
export default DataDate

app/components/ui/DataEmail.jsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { IoMail } from "react-icons/io5"
2+
3+
function DataDate({ title, value }) {
4+
return (
5+
<div
6+
className='flex flex-col gap-2 w-72 sm:w-80 p-4 shadow shadow-base-300'
7+
>
8+
<span
9+
className='font-bold'
10+
>
11+
{title}
12+
</span>
13+
<div
14+
className='flex items-center gap-4 '
15+
>
16+
<IoMail />
17+
<div
18+
className='p-4 whitespace-nowrap opacity-70 w-full overflow-x-scroll scrollbar-thin scrollbar-track-base-200 scrollbar-thumb-base-300 bg-base-200 rounded-md'
19+
>
20+
{value}
21+
</div>
22+
</div>
23+
</div>
24+
)
25+
}
26+
27+
export default DataDate

app/components/ui/DataLaboratory.jsx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import React from 'react'
2+
import { singleLinks } from '@config/admin/singleLinks'
3+
import Link from "next/link"
4+
5+
function DataLaboratory({ title, id }) {
6+
return (
7+
<div
8+
className='
9+
flex flex-col gap-2 w-72
10+
sm:w-80 p-4 shadow shadow-base-300'
11+
>
12+
<span
13+
className='font-bold'
14+
>
15+
{title}
16+
</span>
17+
<div
18+
className='tooltip flex items-center gap-4 '
19+
data-tip={"Voir laboratoire"}
20+
>
21+
{singleLinks.laboratories.icon}
22+
<Link
23+
href={`${singleLinks.laboratories.href}/${id}`}
24+
className='
25+
hover:link-info
26+
p-4 whitespace-nowrap
27+
cursor-pointer
28+
opacity-70 w-full overflow-x-scroll
29+
scrollbar-thin scrollbar-track-base-200
30+
scrollbar-thumb-base-300 bg-base-200
31+
rounded-md'
32+
>
33+
{id}
34+
</Link>
35+
</div>
36+
</div>
37+
)
38+
}
39+
40+
export default DataLaboratory

app/components/ui/DataMoney.jsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { HiCurrencyDollar } from "react-icons/hi2"
2+
3+
function DataMoney({ title, value }) {
4+
return (
5+
<div
6+
className='flex flex-col gap-2 w-72 sm:w-80 p-4 shadow shadow-base-300'
7+
>
8+
<span
9+
className='font-bold'
10+
>
11+
{title}
12+
</span>
13+
<div
14+
className='flex items-center gap-4 '
15+
>
16+
<HiCurrencyDollar />
17+
<div
18+
className='p-4 whitespace-nowrap opacity-70 w-full overflow-x-scroll scrollbar-thin scrollbar-track-base-200 scrollbar-thumb-base-300 bg-base-200 rounded-md'
19+
>
20+
{value}
21+
</div>
22+
</div>
23+
</div>
24+
)
25+
}
26+
27+
export default DataMoney

0 commit comments

Comments
 (0)
0