diff --git a/src/app/(main)/boards/BoardEntityBadge.tsx b/src/app/(main)/boards/BoardEntityBadge.tsx index 3a3e1d554..31d7081ab 100644 --- a/src/app/(main)/boards/BoardEntityBadge.tsx +++ b/src/app/(main)/boards/BoardEntityBadge.tsx @@ -1,33 +1,8 @@ import { Icon, Row, Text } from '@umami/react-zen'; -import { useState } from 'react'; -import { Globe, Grid2x2, Link } from '@/components/icons'; +import { Favicon } from '@/components/common/Favicon'; +import { Grid2x2, Link } from '@/components/icons'; import type { BoardEntityType } from '@/lib/boards'; -const HOSTNAME_REGEX = /^(?:https?:\/\/)?(?:[^@\n]+@)?([^:/\n?=]+)/im; - -function WebsiteIcon({ domain }: { domain?: string }) { - const [failed, setFailed] = useState(false); - - if (domain && !failed) { - const match = domain.match(HOSTNAME_REGEX); - const hostname = match?.[1]; - - if (hostname) { - return ( - setFailed(true)} - /> - ); - } - } - - return ; -} - export function BoardEntityBadge({ type, name, @@ -45,7 +20,7 @@ export function BoardEntityBadge({ ) : type === 'link' ? ( ) : ( - + )} {name}