diff --git a/package-lock.json b/package-lock.json
index 64f83b0..9035eb6 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -15,6 +15,7 @@
"react-router-dom": "^6.23.1"
},
"devDependencies": {
+ "@types/nprogress": "^0.2.3",
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@typescript-eslint/eslint-plugin": "^7.2.0",
@@ -1317,6 +1318,12 @@
"integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==",
"dev": true
},
+ "node_modules/@types/nprogress": {
+ "version": "0.2.3",
+ "resolved": "https://registry.npmjs.org/@types/nprogress/-/nprogress-0.2.3.tgz",
+ "integrity": "sha512-k7kRA033QNtC+gLc4VPlfnue58CM1iQLgn1IMAU8VPHGOj7oIHPp9UlhedEnD/Gl8evoCjwkZjlBORtZ3JByUA==",
+ "dev": true
+ },
"node_modules/@types/prop-types": {
"version": "15.7.12",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.12.tgz",
diff --git a/package.json b/package.json
index eb27ea8..3101b22 100644
--- a/package.json
+++ b/package.json
@@ -17,6 +17,7 @@
"react-router-dom": "^6.23.1"
},
"devDependencies": {
+ "@types/nprogress": "^0.2.3",
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@typescript-eslint/eslint-plugin": "^7.2.0",
diff --git a/src/components/alert/Alert.tsx b/src/components/alert/Alert.tsx
index a366b20..5123bd5 100644
--- a/src/components/alert/Alert.tsx
+++ b/src/components/alert/Alert.tsx
@@ -1,5 +1,16 @@
-const Alert = ({ children, type, message }) => {
- const types = {
+import { AlertProps, MessageType } from "../../types/alertProps";
+
+const Alert = ({ children, type = "info", message }: AlertProps) => {
+ const types: Record<
+ MessageType,
+ {
+ text: string;
+ bg: string;
+ darkText: string;
+ darkBg: string;
+ iconPath: string;
+ }
+ > = {
info: {
text: "text-blue-800",
bg: "bg-blue-50",
@@ -42,8 +53,7 @@ const Alert = ({ children, type, message }) => {
},
};
- const { text, bg, darkText, darkBg, iconPath, title } =
- types[type] || types.info;
+ const { text, bg, darkText, darkBg, iconPath } = types[type];
return (
{
>
-
Info
+
{children}
{children} {message}
diff --git a/src/assets/button/index.tsx b/src/components/button/index.tsx
similarity index 70%
rename from src/assets/button/index.tsx
rename to src/components/button/index.tsx
index f0d005a..4b7d807 100644
--- a/src/assets/button/index.tsx
+++ b/src/components/button/index.tsx
@@ -1,4 +1,6 @@
-function Button({ children, onClick, extra }) {
+import { ButtonProps } from "../../types/buttonProps";
+
+function Button({ children, onClick, extra }: ButtonProps) {
return (