diff --git a/src/pages/Posts.tsx b/src/pages/Posts.tsx
index 297f7d7..7df758d 100644
--- a/src/pages/Posts.tsx
+++ b/src/pages/Posts.tsx
@@ -2,9 +2,10 @@
import { v4 as uuidv4 } from "uuid";
import React, { useContext, useEffect, useState } from "react";
import { PostContext } from "../context/PostContext";
+import { IconContext } from "react-icons";
// Icons
-import { BsFillFileEarmarkPostFill } from "react-icons/bs";
+import { FaBox } from "react-icons/fa";
import { BiLinkExternal } from "react-icons/bi";
// Helpers
@@ -12,7 +13,6 @@ import { getPosts } from "../helpers/apiRequests";
import { PostType } from "../types/posts";
import { Link } from "react-router-dom";
import { parseDate } from "../helpers/parseDate";
-// import { capitalizeFirstLetter } from "../helpers/stringMethods";
// Types
import { paramsType } from "../types/posts";
@@ -75,7 +75,9 @@ const Posts = () => {
-
+
+
+
Posts
@@ -140,7 +142,7 @@ const Posts = () => {
-
+
| {
Updated
|
+
+
{posts[0] ? (
posts[0].id !== -1 ? (
category === "All" ? (
diff --git a/src/pages/Source.tsx b/src/pages/Source.tsx
new file mode 100644
index 0000000..e9068fe
--- /dev/null
+++ b/src/pages/Source.tsx
@@ -0,0 +1,139 @@
+// Modules
+import { v4 as uuidv4 } from "uuid";
+import { useState, useEffect } from "react";
+import { IconContext } from "react-icons";
+import { Link } from "react-router-dom";
+
+// Icons
+import { FaSourcetree } from "react-icons/fa";
+import { FaRegEdit } from "react-icons/fa";
+import { FaTrash } from "react-icons/fa";
+import { getLinks } from "../helpers/apiRequests";
+
+// Helpers
+import { deleteLink } from "../helpers/apiRequests";
+
+// Types
+import { LinksAll } from "../types/links";
+// interface dataType {
+// createName: string;
+// createLink: string;
+// delete: number;
+// updateId: number;
+// updateName: string;
+// updateLink: string;
+// }
+// interface successType {
+// create: string;
+// delete: string;
+// update: string;
+// hasCreateUpdated: boolean;
+// hasDeleteUpdated: boolean;
+// hasUpdateUpdated: boolean;
+// }
+
+const Source = () => {
+ const defaultDate = new Date("00-00-00");
+
+ const [deleted, setDeleted] = useState(false);
+
+ const [all, setAll] = useState([
+ {
+ id: -1,
+ name: "",
+ source: "",
+ createdAt: defaultDate,
+ updatedAt: defaultDate,
+ },
+ ]);
+
+ useEffect(() => {
+ getLinks(setAll);
+ }, []);
+
+ useEffect(() => {
+ if (deleted) {
+ setTimeout(() => {
+ setDeleted(false);
+ getLinks(setAll);
+ }, 2000);
+ }
+ }, [deleted, setDeleted]);
+
+ return (
+
+
+
+
+
+
+
+
Source
+
+
+
All sources
+
+
+
+ | ID |
+ Name |
+ Source |
+ Actions |
+
+
+
+ {all[0].id !== -1 ? (
+ all.map((source: LinksAll) => {
+ return (
+
+ | {source.id} |
+ {source.name} |
+
+ {source.source}
+ |
+
+
+
+ Edit
+
+
+
+
+
+
+
+
+ |
+
+ );
+ })
+ ) : (
+
+ |
+ |
+ |
+
+ )}
+
+
+
+
+
+
+ );
+};
+
+export default Source;