import type { IRoom, Serialized } from '@rocket.chat/core-typings'; import { Box, CheckBox, Icon, Margins } from '@rocket.chat/fuselage'; import { useStableCallback } from '@rocket.chat/fuselage-hooks'; import { GenericTableRow, GenericTableCell } from '@rocket.chat/ui-client'; import { useId } from 'react'; import { useFormatDateAndTime } from '../../../hooks/useFormatDateAndTime'; export type ChannelDesertionTableRowProps = { onChange: (room: Serialized & { isLastOwner?: boolean }) => void; selected: boolean; room: Serialized & { isLastOwner?: boolean }; lastOwnerWarning?: string; }; const ChannelDesertionTableRow = ({ room, onChange, selected, lastOwnerWarning }: ChannelDesertionTableRowProps) => { const { name, fname, ts, isLastOwner } = room; const formatDate = useFormatDateAndTime(); const checkboxId = useId(); const handleChange = useStableCallback(() => onChange(room)); return ( {fname ?? name} {isLastOwner && } {formatDate(ts)} ); }; export default ChannelDesertionTableRow;