 
     weak var delegate: ChatMessageTextViewProtocol?
 
-    var attachment: Attachment? {
+    var viewModel: ChatMessageTextViewModel? {
         didSet {
-            guard let attachment = attachment else { return }
-            viewModel = ChatMessageTextViewModel(withAttachment: attachment)
-            updateMessageInformation()
+            prepareView()
         }
     }
-
-    var viewModel: ChatMessageTextViewModel?
 
     private static let imageViewDefaultWidth = CGFloat(50)
 

        return UITapGestureRecognizer(target: self, action: #selector(viewDidTapped(_:)))
    }()

    private func updateMessageInformation() {

        let containsGesture = gestureRecognizers?.contains(tapGesture) ?? false
        if !containsGesture {
            addGestureRecognizer(tapGesture)
        }

        viewLeftBorder.backgroundColor = viewModel?.color

        labelTitle.text = viewModel?.title
        labelDescription.text = viewModel?.text

        let updateConstraint = { [weak self] (constant: CGFloat) in
            self?.imageViewThumbWidthConstraint.constant = constant
            self?.layoutSubviews()

        ) + 20)
    }

    // MARK: Actions

    func viewDidTapped(_ sender: Any) {
        viewModel?.toggleCollpase()
        delegate?.viewDidCollpaseChange(view: self)
    }

    private func addGestureIfNeeded() {
        let containsGesture = gestureRecognizers?.contains(tapGesture) ?? false
        if !containsGesture {
            addGestureRecognizer(tapGesture)
        }
    }
}
