mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-02-20 07:44:01 -05:00
Refactor UserLinkFromId component to enforce userId type and remove null checks
This commit is contained in:
@@ -107,7 +107,7 @@ export function EventCard(props: {
|
||||
</p>
|
||||
{event.participants.length > 0 && (
|
||||
<div className="flex flex-wrap gap-1 mt-2">
|
||||
{event.participants.map((participantId: any) => (
|
||||
{event.participants.map((participantId: string) => (
|
||||
<span key={participantId} className="bg-canvas-100 text-ink-700 px-2 py-1 rounded text-xs">
|
||||
<UserLinkFromId userId={participantId}/>
|
||||
</span>
|
||||
|
||||
@@ -32,10 +32,9 @@ export function UserLink({user, className = ""}: {
|
||||
}
|
||||
|
||||
export function UserLinkFromId({userId, className = ""}: {
|
||||
userId: string | null | undefined
|
||||
userId: string
|
||||
className?: string
|
||||
}) {
|
||||
if (!userId) return null
|
||||
const user = useUserInStore(userId)
|
||||
return <UserLink user={user} className={className}/>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user