Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 2x 2x 2x 2x 2x 1x 1x 1x 1x 1x 1x 1x | import { omit } from 'lodash-es';
import { memo } from 'react';
import { type KeysOfUserWithStringValues } from '@amalia/tenants/users/types';
import { UserFetchContainer, type UserFetchContainerProps } from '../fetch-container/UserFetchContainer';
import { UserNullValue } from '../null-value/UserNullValue';
import { USER_NULL_VALUE } from '../types';
export type UserContainerProps<TProperty extends KeysOfUserWithStringValues> = UserFetchContainerProps<TProperty>;
export const UserContainerBase = function UserContainerBase<TProperty extends KeysOfUserWithStringValues>(
props: UserContainerProps<TProperty>,
) {
const { value } = props;
if (value.toLowerCase() === USER_NULL_VALUE) {
return <UserNullValue {...omit(props, 'isComputing')} />;
}
return <UserFetchContainer {...props} />;
};
export const UserContainer = memo(UserContainerBase) as typeof UserContainerBase;
|