import { Card, Group, Text } from '@mantine/core'; // Import de Mantine import { AiFillStar } from 'react-icons/ai'; import { ExternalLinkStyled } from '~/components/common/external_link_styled'; import LinkFavicon from '~/components/dashboard/link/link_favicon'; import { Link } from '~/types/app'; import styles from './link.module.css'; export default function LinkItem({ link, showUserControls = false, }: { link: Link; showUserControls: boolean; }) { const { name, url, description, favorite } = link; return (
{name}{' '} {showUserControls && favorite && }
{/* {showUserControls && } */}
{description && ( {description} )}
); } function LinkItemURL({ url }: { url: Link['url'] }) { try { const { origin, pathname, search } = new URL(url); let text = ''; if (pathname !== '/') { text += pathname; } if (search !== '') { if (text === '') { text += '/'; } text += search; } return ( {origin} {text} ); } catch (error) { console.error('error', error); return ( {url} ); } }