import { Image, Space, Tag } from 'antd'; import dayjs from 'dayjs'; import relativeTime from 'dayjs/plugin/relativeTime'; dayjs.extend(relativeTime); export const renderTextHelper = { TagList(items: { label: string; value: string; color: string }[]) { return ( {items?.map((item) => ( {item.label} ))} ); }, Tag({ Enums, value, isColor = true, }: { Enums?: any; value?: any; isColor?: any; }) { let item: any = Object.values(Enums).find((data: any) => { return data.value === '' + value; }); return isColor ? ( {item?.text} ) : ( <>{item?.text} ); }, Images(images: string[]) { return ( {images?.map((img: any) => ( ))} ); }, RelativeTo(value: string) { return dayjs().to(dayjs(value)); }, };