import { Anchor, Avatar } from "@mantine/core"; import type { FC } from "react"; import { useState } from "react"; import { Link } from "react-router"; type PositionLogoProps = { src: string | null; label: string; to?: string; }; const PositionLogo: FC = (props) => { const { src, label } = props; const [failed, setFailed] = useState(false); const logo = src && !failed ? ( setFailed(true)} /> ) : ( {(label.trim()[0] ?? "?").toUpperCase()} ); return props.to ? ( {logo} ) : ( logo ); }; export { PositionLogo };