diff --git a/apps/web/src/components/happening/registrations-preview.tsx b/apps/web/src/components/happening/registrations-preview.tsx index 3ae39ecb9..9beb03956 100644 --- a/apps/web/src/components/happening/registrations-preview.tsx +++ b/apps/web/src/components/happening/registrations-preview.tsx @@ -1,9 +1,16 @@ import { type RegistrationStatus } from "@echo-webkom/db/schemas"; -import { ellipsis, initials } from "@/utils/string"; +import { initials } from "@/utils/string"; import { Text } from "../typography/text"; import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar"; -import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from "../ui/dialog"; +import { + Dialog, + DialogBody, + DialogContent, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "../ui/dialog"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../ui/tooltip"; type Registration = { @@ -23,7 +30,7 @@ const ProfilePreview = ({ registration }: ProfilePreviewProps) => { return ( - {fallback} + {fallback} ); }; @@ -32,7 +39,7 @@ type RegistrationsPreviewProps = { registrations: Array; }; -const MAX = 7; +const MAX = 13; export const RegistrationsPreview = ({ registrations }: RegistrationsPreviewProps) => { const sorted = registrations @@ -52,7 +59,7 @@ export const RegistrationsPreview = ({ registrations }: RegistrationsPreviewProp } const extra = registrations.length - MAX; - const names = `${sorted.map((registration) => ellipsis(registration.name ?? "", 7)).join(", ")}${ + const names = `${sorted.map((registration) => registration.name?.split(" ")[0]).join(", ")}${ extra > 0 ? ` +${extra}` : "" }`; @@ -87,7 +94,7 @@ export const RegistrationsPreview = ({ registrations }: RegistrationsPreviewProp PĆ„meldte brukere -
+ {registrations .filter((registration) => registration.status === "registered") .map((registration) => ( @@ -96,7 +103,7 @@ export const RegistrationsPreview = ({ registrations }: RegistrationsPreviewProp {registration.name}
))} - + );