diff --git a/src/app/(stats)/guild/[value]/_components/sidebar.tsx b/src/app/(stats)/guild/[value]/_components/sidebar.tsx
index d92dbff..cce1fcc 100644
--- a/src/app/(stats)/guild/[value]/_components/sidebar.tsx
+++ b/src/app/(stats)/guild/[value]/_components/sidebar.tsx
@@ -1,9 +1,9 @@
+import { ReplaceLinks } from "@/components/link-replace"
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
import { Separator } from "@/components/ui/separator"
import { getColor } from "@/lib/colors"
import { Guild } from "@/lib/schema/guild"
import { cn } from "@/lib/utils"
-import Link from "next/link"
type SidebarProps = { guild: Guild["guild"] }
@@ -26,23 +26,3 @@ export default function Sidebar({ guild }: SidebarProps) {
)
}
-
-function ReplaceLinks({ text }: { text: string }) {
- const regex = /(https?:\/\/[^\s/$.?#].[^\s]*)/g
- const parts = text.split(regex)
-
- return (
-
- {parts.map((part, index) => {
- if (regex.test(part)) {
- return (
-
- {part}
-
- )
- }
- return part
- })}
-
- )
-}
diff --git a/src/app/(stats)/player/[ign]/_components/social-icons.tsx b/src/app/(stats)/player/[ign]/_components/social-icons.tsx
index c337042..3ebae95 100644
--- a/src/app/(stats)/player/[ign]/_components/social-icons.tsx
+++ b/src/app/(stats)/player/[ign]/_components/social-icons.tsx
@@ -1,4 +1,5 @@
import { Button } from "@/components/ui/button"
+import { Route } from "next"
import Link from "next/link"
import { CgWebsite } from "react-icons/cg"
import { FaTwitch, FaYoutube } from "react-icons/fa"
@@ -38,7 +39,7 @@ function SocialIcon({ href, children }: { href?: string, children: React.ReactNo
return (
diff --git a/src/components/link-replace.tsx b/src/components/link-replace.tsx
new file mode 100644
index 0000000..511a1e4
--- /dev/null
+++ b/src/components/link-replace.tsx
@@ -0,0 +1,22 @@
+import { Route } from "next"
+import Link from "next/link"
+
+export function ReplaceLinks({ text }: { text: string }) {
+ const regex = /(https?:\/\/[^\s/$.?#].[^\s]*)/g
+ const parts = text.split(regex)
+
+ return (
+
+ {parts.map((part, i) => {
+ if (regex.test(part)) {
+ return (
+
+ {part}
+
+ )
+ }
+ return {part}
+ })}
+
+ )
+}