import { IChatItem } from '../ChatLogsType';

export const ChatVote: React.FC<IChatItem> = (props) => {
  const votetype: any = { 101: '发起投票', 102: '参与投票' };

  function content() {
    return (
      <div style={{ display: 'flex', color: '#000', flexDirection: 'column' }}>
        <div style={{ wordBreak: 'break-all' }}>{props.chat?.votetitle}</div>
        <div style={{ wordBreak: 'break-all' }}>{props.chat?.voteitem}</div>
        <div style={{ borderTop: '1px solid #ddd', color: '#999', marginTop: 8, paddingTop: 8 }}>
          投票 [{votetype[props.chat?.votetype as string]}]
        </div>
      </div>
    );
  }

  return <>{content()}</>;
};
