package com.adealink.weparty.profile.dynamic.fragment.data

import com.adealink.weparty.commonui.recycleview.diffutil.BaseListItemData
import com.adealink.weparty.profile.dynamic.data.DynamicCommentData
import com.adealink.weparty.profile.dynamic.data.DynamicDetailData

sealed class BaseDynamicDetailItem : BaseListItemData

data class DynamicDetailPhotoHeaderItem(
    val data: DynamicDetailData
) : BaseDynamicDetailItem() {
    override fun areContentsTheSame(newItem: Any): Boolean {
        if (newItem !is DynamicDetailPhotoHeaderItem) return false
        return data == newItem.data
    }
}

data class DynamicDetailCommentTitleItem(
    val total: Long
) : BaseDynamicDetailItem() {
    override fun areContentsTheSame(newItem: Any): Boolean {
        if (newItem !is DynamicDetailCommentTitleItem) return false
        return total == newItem.total
    }
}

data class DynamicDetailCommentItem(
    val comment: DynamicCommentData
) : BaseDynamicDetailItem() {
    var isExpand = false

    override fun areContentsTheSame(newItem: Any): Boolean {
        if (newItem !is DynamicDetailCommentItem) return false
        return comment == newItem.comment &&
                isExpand == newItem.isExpand
    }
}