diff --git a/frontend/src/components/description.tsx b/frontend/src/components/description.tsx index 0109550..6b5f22d 100644 --- a/frontend/src/components/description.tsx +++ b/frontend/src/components/description.tsx @@ -1,42 +1,42 @@ -import { Icon } from "@iconify/react"; - -interface Props { - text: string; - className?: string; -} - -// Adds fancy formatting to links -export default function Description({ text, className }: Props) { - const urlRegex = /(https?:\/\/[^\s]+)/g; - const parts = text.split(urlRegex); - - return ( -
- {parts.map(async (part, index) => {
- try {
- // Check if it's a URL
- if (!urlRegex.test(part)) throw new Error("Not a URL");
- const url = new URL(part);
-
- return (
-
- {url.hostname}
- {url.pathname !== "/" ? url.pathname : ""}
- {url.search}
-
+ {parts.map((part, index) => {
+ try {
+ // Check if it's a URL
+ if (!urlRegex.test(part)) throw new Error("Not a URL");
+ const url = new URL(part);
+
+ return (
+
+ {url.hostname}
+ {url.pathname !== "/" ? url.pathname : ""}
+ {url.search}
+