MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / CommunityCard

Function CommunityCard

apps/web/ui/CommunityCard/index.tsx:9–49  ·  view source on GitHub ↗
({
  className,
  community,
}: {
  className?: string;
  community: SerializedAccount;
})

Source from the content-addressed store, hash-verified

7import { getHomeUrl } from '@linen/utilities/home';
8
9function CommunityCard({
10 className,
11 community,
12}: {
13 className?: string;
14 community: SerializedAccount;
15}) {
16 if (community.logoUrl) {
17 return (
18 <a
19 className={classNames(styles.logo, className)}
20 style={{
21 backgroundColor: community.brandColor,
22 }}
23 href={getHomeUrl(community)}
24 target="_blank"
25 rel="noreferrer"
26 >
27 <img
28 src={community.logoUrl as string}
29 alt="Logo"
30 height="50"
31 width="200"
32 />
33 </a>
34 );
35 }
36 return (
37 <a
38 href={getHomeUrl(community)}
39 className={classNames(styles.card, className)}
40 target="_blank"
41 >
42 <CommunityIcon community={community} />
43 <div className={styles.content}>
44 <h2>{community.name}</h2>
45 {community.description && <p>{truncate(community.description, 160)}</p>}
46 </div>
47 </a>
48 );
49}
50export default CommunityCard;

Callers

nothing calls this directly

Calls 2

getHomeUrlFunction · 0.90
truncateFunction · 0.90

Tested by

no test coverage detected