diff --git a/app/(base)/pcp/page.tsx b/app/(base)/pcp/page.tsx index c5d2080..611570c 100644 --- a/app/(base)/pcp/page.tsx +++ b/app/(base)/pcp/page.tsx @@ -2,7 +2,7 @@ import NavigationBar from "@/components/NavigationBar"; import PipResource from "@/components/PipResource"; import PipTask from "@/components/PipTask"; -import ProgressBar from "@/components/Progressbar"; +import ProgressBar from "@/components/ProgressBar"; import { getUserTasks, getUserResources, diff --git a/components/PipResource.tsx b/components/PipResource.tsx new file mode 100644 index 0000000..c1bba4d --- /dev/null +++ b/components/PipResource.tsx @@ -0,0 +1,55 @@ +import Link from "next/link"; +import ArticleIcon from "../components/icons/ArticleIcon"; +import BookIcon from "../components/icons/BookIcon"; +import VideoIcon from "../components/icons/VideoIcon"; + +interface InterfacePipResource { + title: string | null; + description: string | null; + type: string | null; +} + +const PipResource = ({ title, description, type }: InterfacePipResource) => { + const renderIcon = () => { + switch (type) { + case "video": + return ; + case "book": + return ; + case "article": + return ; + default: + return ; + } + }; + + const renderButtonLabel = () => { + switch (type) { + case "video": + return "Watch it"; + case "book": + return "Get it"; + case "article": + return "Read it"; + default: + return "Read it"; + } + }; + + return ( +
+
+ {renderIcon()} +

{title}

+
+

+ {description} +

+ +
+ ); +}; + +export default PipResource; diff --git a/components/PipTask.tsx b/components/PipTask.tsx new file mode 100644 index 0000000..92d111e --- /dev/null +++ b/components/PipTask.tsx @@ -0,0 +1,36 @@ +interface InterfacePipTask { + title: string | null; + description: string | null; + isDone: boolean | null; + handleCheck: () => void; +} + +const PipTask = ({ + title, + description, + isDone, + handleCheck, +}: InterfacePipTask) => { + return ( +
+
+

{title}

+
+ +
+
+

+ {description} +

+
+ ); +}; + +export default PipTask; diff --git a/components/ProgressBar.tsx b/components/ProgressBar.tsx new file mode 100644 index 0000000..79fab5f --- /dev/null +++ b/components/ProgressBar.tsx @@ -0,0 +1,17 @@ +interface InterfaceProgressBar { + width: number; // percentage + height: number; // height in talwindcss +} + +const ProgressBar = ({ width, height }: InterfaceProgressBar) => { + return ( +
+
+
+ ); +}; + +export default ProgressBar; diff --git a/components/icons/ArticleIcon.tsx b/components/icons/ArticleIcon.tsx new file mode 100644 index 0000000..8fa5417 --- /dev/null +++ b/components/icons/ArticleIcon.tsx @@ -0,0 +1,23 @@ +interface InterfaceArticle { + size: string; + color: string; +} + +const ArticleIcon = ({ size, color }: InterfaceArticle) => ( + + + +); + +export default ArticleIcon; diff --git a/components/icons/BookIcon.tsx b/components/icons/BookIcon.tsx new file mode 100644 index 0000000..c3a3e8e --- /dev/null +++ b/components/icons/BookIcon.tsx @@ -0,0 +1,22 @@ +interface InterfaceBookIcon { + color: string; + size: string; +} +const BookIcon = ({ color, size }: InterfaceBookIcon) => ( + + + +); + +export default BookIcon; diff --git a/components/NotificationIcon.tsx b/components/icons/NotificationIcon.tsx similarity index 100% rename from components/NotificationIcon.tsx rename to components/icons/NotificationIcon.tsx diff --git a/components/icons/VideoIcon.tsx b/components/icons/VideoIcon.tsx new file mode 100644 index 0000000..e58e4e1 --- /dev/null +++ b/components/icons/VideoIcon.tsx @@ -0,0 +1,25 @@ +interface InterfaceVideoIcon { + color: string; + size: string; +} + +const VideoIcon = ({ color, size }: InterfaceVideoIcon) => { + return ( + + + + ); +}; + +export default VideoIcon;