new component

This commit is contained in:
Laux Dev
2026-03-03 14:07:22 +08:00
parent f0b3c443c0
commit 62c438eed0
9 changed files with 47 additions and 107 deletions

View File

@@ -5,6 +5,9 @@ import styles from "./styles.module.css";
import TopHeader from "../components/topHeader/TopHeader"; import TopHeader from "../components/topHeader/TopHeader";
import globalStyle from "../globalStyle.module.css"; import globalStyle from "../globalStyle.module.css";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
import ActionButton from "../components/actionButton/ActionButton";
import DeleteIcon from "../components/icons/delete";
import ViewIcon from "../components/icons/view";
const AgentsPage = () => { const AgentsPage = () => {
const router = useRouter(); const router = useRouter();
@@ -135,70 +138,10 @@ const AgentsPage = () => {
<td> <td>
<div className={styles.actions}> <div className={styles.actions}>
<div> <div>
<button className={styles.iconButton}> <ActionButton icon={<ViewIcon />} />
<svg
xmlns="http://www.w3.org/2000/svg"
width={20}
height={20}
viewBox="0 0 20 20"
fill="none"
>
<path
d="M8.40234 9.99957C8.40234 10.4232 8.57062 10.8294 8.87016 11.129C9.1697 11.4285 9.57596 11.5968 9.99957 11.5968C10.4232 11.5968 10.8294 11.4285 11.129 11.129C11.4285 10.8294 11.5968 10.4232 11.5968 9.99957C11.5968 9.57596 11.4285 9.1697 11.129 8.87016C10.8294 8.57062 10.4232 8.40234 9.99957 8.40234C9.57596 8.40234 9.1697 8.57062 8.87016 8.87016C8.57062 9.1697 8.40234 9.57596 8.40234 9.99957Z"
stroke="#969AF9"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M17.1875 9.99967C15.2708 13.1941 12.875 14.7913 10 14.7913C7.125 14.7913 4.72917 13.1941 2.8125 9.99967C4.72917 6.80523 7.125 5.20801 10 5.20801C12.875 5.20801 15.2708 6.80523 17.1875 9.99967Z"
stroke="#969AF9"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
</button>
</div> </div>
<div> <div>
<button className={styles.iconButton}> <ActionButton icon={<DeleteIcon />} />
<svg
xmlns="http://www.w3.org/2000/svg"
width={20}
height={20}
viewBox="0 0 20 20"
fill="none"
>
<path
d="M3.61133 6.00684H16.3891"
stroke="#969AF9"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M8.40234 9.20117V13.9928"
stroke="#969AF9"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M11.5977 9.20117V13.9928"
stroke="#969AF9"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M4.41016 6.00684L5.20877 15.5902C5.20877 16.0138 5.37705 16.42 5.67658 16.7196C5.97612 17.0191 6.38238 17.1874 6.80599 17.1874H13.1949C13.6185 17.1874 14.0247 17.0191 14.3243 16.7196C14.6238 16.42 14.7921 16.0138 14.7921 15.5902L15.5907 6.00684"
stroke="#969AF9"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M7.60352 6.00694V3.61111C7.60352 3.39931 7.68765 3.19618 7.83742 3.04641C7.98719 2.89664 8.19032 2.8125 8.40213 2.8125H11.5966C11.8084 2.8125 12.0115 2.89664 12.1613 3.04641C12.311 3.19618 12.3952 3.39931 12.3952 3.61111V6.00694"
stroke="#969AF9"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
</button>
</div> </div>
</div> </div>
</td> </td>

View File

@@ -0,0 +1,8 @@
import React from "react";
import styles from "./styles.module.css";
const ActionButton = ({ icon }) => {
return <button className={styles.iconButton}>{icon}</button>;
};
export default ActionButton;

View File

@@ -0,0 +1,21 @@
.iconButton {
display: flex;
padding: 6px;
flex-direction: column;
justify-content: center;
align-items: center;
flex-shrink: 0;
aspect-ratio: 1/1;
background-color: rgba(255, 255, 255, 0);
outline: none;
border: 1px solid #959aff00;
cursor: pointer;
border-radius: 50%;
}
.iconButton:hover {
border: 1px solid #959aff;
background: linear-gradient(180deg, #696b95 0%, #20202d 100%);
}
.iconButton:hover path {
stroke: white;
}

View File

@@ -4,6 +4,7 @@ import globalStyle from "../globalStyle.module.css";
import styles from "./styles.module.css"; import styles from "./styles.module.css";
import DeleteIcon from "../components/icons/delete"; import DeleteIcon from "../components/icons/delete";
import SuccessToast from "../components/toast/success/successToast"; import SuccessToast from "../components/toast/success/successToast";
import ActionButton from "../components/actionButton/ActionButton";
const CredentialsPage = () => { const CredentialsPage = () => {
const sampleData = [ const sampleData = [
{ {
@@ -83,9 +84,7 @@ const CredentialsPage = () => {
<td>{org.organizationID}</td> <td>{org.organizationID}</td>
<td className={styles.actions}> <td className={styles.actions}>
<div> <div>
<button className={styles.iconButton}> <ActionButton icon={<DeleteIcon />} />
<DeleteIcon />
</button>
</div> </div>
</td> </td>
</tr> </tr>

View File

@@ -52,24 +52,3 @@
font-weight: 500; font-weight: 500;
line-height: normal; line-height: normal;
} }
.iconButton {
display: flex;
padding: 6px;
flex-direction: column;
justify-content: center;
align-items: center;
flex-shrink: 0;
aspect-ratio: 1/1;
background-color: rgba(255, 255, 255, 0);
outline: none;
border: 1px solid #959aff00;
cursor: pointer;
border-radius: 50%;
}
.iconButton:hover {
border: 1px solid #959aff;
background: linear-gradient(180deg, #696b95 0%, #20202d 100%);
}
.iconButton:hover path {
stroke: white;
}

View File

@@ -5,6 +5,7 @@ import TopHeader from "../components/topHeader/TopHeader";
import globalStyle from "../globalStyle.module.css"; import globalStyle from "../globalStyle.module.css";
import SuccessToast from "../components/toast/success/successToast"; import SuccessToast from "../components/toast/success/successToast";
import DeleteIcon from "../components/icons/delete"; import DeleteIcon from "../components/icons/delete";
import ActionButton from "../components/actionButton/ActionButton";
const OrganizationPage = () => { const OrganizationPage = () => {
const sampleData = [ const sampleData = [
@@ -81,9 +82,7 @@ const OrganizationPage = () => {
<td>{org.dateCreated}</td> <td>{org.dateCreated}</td>
<td className={styles.actions}> <td className={styles.actions}>
<div> <div>
<button className={styles.iconButton}> <ActionButton icon={<DeleteIcon />} />
<DeleteIcon />
</button>
</div> </div>
</td> </td>
</tr> </tr>

View File

@@ -7,6 +7,7 @@ import { useRouter } from "next/navigation";
import SuccessToast from "../components/toast/success/successToast"; import SuccessToast from "../components/toast/success/successToast";
import DeleteIcon from "../components/icons/delete"; import DeleteIcon from "../components/icons/delete";
import ViewIcon from "../components/icons/view"; import ViewIcon from "../components/icons/view";
import ActionButton from "../components/actionButton/ActionButton";
const ProjectsPage = () => { const ProjectsPage = () => {
const router = useRouter(); const router = useRouter();
const sampleData = [ const sampleData = [
@@ -224,14 +225,10 @@ const ProjectsPage = () => {
<td> <td>
<div className={styles.actions}> <div className={styles.actions}>
<div> <div>
<button className={styles.iconButton}> <ActionButton icon={<ViewIcon />} />
<ViewIcon />
</button>
</div> </div>
<div> <div>
<button className={styles.iconButton}> <ActionButton icon={<DeleteIcon />} />
<DeleteIcon />
</button>
</div> </div>
</div> </div>
</td> </td>

View File

@@ -8,6 +8,7 @@ import { useRouter } from "next/navigation";
import ViewIcon from "../components/icons/view"; import ViewIcon from "../components/icons/view";
import DeleteIcon from "../components/icons/delete"; import DeleteIcon from "../components/icons/delete";
import SuccessToast from "../components/toast/success/successToast"; import SuccessToast from "../components/toast/success/successToast";
import ActionButton from "../components/actionButton/ActionButton";
const RolesPage = () => { const RolesPage = () => {
const router = useRouter(); const router = useRouter();
@@ -78,12 +79,8 @@ const RolesPage = () => {
<td>{role.permissions}</td> <td>{role.permissions}</td>
<td> <td>
<div className={styles.tableActions}> <div className={styles.tableActions}>
<button className={styles.viewBtn}> <ActionButton icon={<ViewIcon />} />
<ViewIcon /> <ActionButton icon={<DeleteIcon />} />
</button>
<button className={styles.deleteBtn}>
<DeleteIcon />
</button>
</div> </div>
</td> </td>
</tr> </tr>

View File

@@ -7,6 +7,7 @@ import { useRouter } from "next/navigation";
import ViewIcon from "../components/icons/view"; import ViewIcon from "../components/icons/view";
import DeleteIcon from "../components/icons/delete"; import DeleteIcon from "../components/icons/delete";
import SuccessToast from "../components/toast/success/successToast"; import SuccessToast from "../components/toast/success/successToast";
import ActionButton from "../components/actionButton/ActionButton";
const UsersPage = () => { const UsersPage = () => {
const router = useRouter(); const router = useRouter();
@@ -63,12 +64,8 @@ const UsersPage = () => {
<td>{user.createdAt}</td> <td>{user.createdAt}</td>
<td> <td>
<div className={styles.tableActions}> <div className={styles.tableActions}>
<button className={styles.viewBtn}> <ActionButton icon={<ViewIcon />} />
<ViewIcon /> <ActionButton icon={<DeleteIcon />} />
</button>
<button className={styles.deleteBtn}>
<DeleteIcon />
</button>
</div> </div>
</td> </td>
</tr> </tr>