2023-10-23 23:33:39 +02:00
|
|
|
import { memo } from "react"
|
|
|
|
import Image from "next/image"
|
2022-01-01 20:42:25 +01:00
|
|
|
|
2023-10-23 23:33:39 +02:00
|
|
|
import type { GuildWithDefaultChannelId } from "../../../models/Guild"
|
|
|
|
import { IconLink } from "../../design/IconLink"
|
2022-01-01 20:42:25 +01:00
|
|
|
|
|
|
|
export interface GuildProps {
|
|
|
|
guild: GuildWithDefaultChannelId
|
|
|
|
selected?: boolean
|
|
|
|
}
|
|
|
|
|
2022-08-30 21:30:06 +02:00
|
|
|
const GuildMemo: React.FC<GuildProps> = (props) => {
|
2022-01-01 20:42:25 +01:00
|
|
|
const { guild, selected } = props
|
|
|
|
|
|
|
|
return (
|
|
|
|
<IconLink
|
2023-10-23 23:33:39 +02:00
|
|
|
className="mt-2"
|
2022-01-01 20:42:25 +01:00
|
|
|
href={`/application/${guild.id}/${guild.defaultChannelId}`}
|
|
|
|
selected={selected}
|
|
|
|
title={guild.name}
|
|
|
|
>
|
2023-10-23 23:33:39 +02:00
|
|
|
<div className="pl-[6px]">
|
2022-01-01 20:42:25 +01:00
|
|
|
<Image
|
2022-04-07 16:54:05 +02:00
|
|
|
quality={100}
|
2023-10-23 23:33:39 +02:00
|
|
|
className="rounded-full"
|
2022-01-01 20:42:25 +01:00
|
|
|
src={
|
2023-10-23 23:33:39 +02:00
|
|
|
guild.icon != null ? guild.icon : "/images/data/guild-default.png"
|
2022-01-01 20:42:25 +01:00
|
|
|
}
|
2023-10-23 23:33:39 +02:00
|
|
|
alt="logo"
|
2022-01-01 20:42:25 +01:00
|
|
|
width={48}
|
|
|
|
height={48}
|
|
|
|
draggable={false}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</IconLink>
|
|
|
|
)
|
|
|
|
}
|
2022-08-30 21:30:06 +02:00
|
|
|
|
|
|
|
export const Guild = memo(GuildMemo)
|