import React from 'react';
import { conditionChaining, truncatedCount } from '@sendbird/uikit-utils';
import Box from '../../components/Box';
import Icon from '../../components/Icon';
import Image from '../../components/Image';
import Text from '../../components/Text';
import createStyleSheet from '../../styles/createStyleSheet';
import useUIKitTheme from '../../theme/useUIKitTheme';
type Props = {
customCover?: React.ReactNode;
coverUrl: string;
title: string;
participantsCount?: number;
frozen?: boolean;
};
const OpenChannelPreview = ({ customCover, coverUrl, participantsCount = 0, title, frozen }: Props) => {
const { colors } = useUIKitTheme();
const color = colors.ui.openChannelPreview.default.none;
return (
{conditionChaining(
[Boolean(customCover)],
[
customCover,
,
],
)}
{title}
{frozen && }
{truncatedCount(participantsCount, 999)}
);
};
const Separator = ({ color }: { color: string }) => ;
const styles = createStyleSheet({
channelCover: {
width: 32,
height: 32,
},
channelInfoTitle: {
flexShrink: 1,
},
marginEnd: {
marginEnd: 4,
},
marginStart: {
marginStart: 4,
},
separator: {
position: 'absolute',
start: 0,
end: -16,
bottom: 0,
height: 1,
},
});
export default OpenChannelPreview;