Skip to content

Commit

Permalink
fix(UserGroup): fix types error
Browse files Browse the repository at this point in the history
  • Loading branch information
asabotovich committed Oct 20, 2023
1 parent e2119be commit 544f1c5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/UserGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getUserName, prepareUserDataFromActivity } from '../utils/getUserName';

type User = ComponentProps<typeof UserGroupBricks>['users'][number];

interface UserGroupProps extends ComponentProps<typeof UserGroupBricks> {
interface UserGroupProps extends Omit<ComponentProps<typeof UserGroupBricks>, 'users'> {
users: Array<{
user?: User | null;
ghost?: User | null;
Expand All @@ -15,7 +15,7 @@ interface UserGroupProps extends ComponentProps<typeof UserGroupBricks> {
export const UserGroup = ({ users, ...rest }: UserGroupProps) => {
const extractedUsers = useMemo(
() =>
users.reduce<User>((acc, activity) => {
users.reduce<User[]>((acc, activity) => {
const target = prepareUserDataFromActivity(activity);

if (target != null) {
Expand All @@ -30,5 +30,6 @@ export const UserGroup = ({ users, ...rest }: UserGroupProps) => {
}, []),
[users],
);

return <UserGroupBricks users={extractedUsers} {...rest} />;
};

0 comments on commit 544f1c5

Please sign in to comment.