js for chat ui