feat(creator): 채널 후원 empty 상태를 매핑한다

This commit is contained in:
2026-06-16 19:21:54 +09:00
parent 6ba5bf2cb1
commit a01675b592
3 changed files with 19 additions and 5 deletions

View File

@@ -7,10 +7,11 @@ import kr.co.vividnext.sodalive.v2.creator.channel.data.CreatorChannelSnsRespons
import java.net.URI
fun CreatorChannelHomeResponse.toUiContent(currentMemberId: Long): CreatorChannelHomeUiState.Content {
val isOwner = creator.creatorId == currentMemberId
val sections = buildList {
currentLive?.let { add(CreatorChannelHomeSection.CurrentLive(it)) }
latestAudioContent?.let { add(CreatorChannelHomeSection.LatestAudioContent(it)) }
channelDonations.takeIf { it.isNotEmpty() }?.let { add(CreatorChannelHomeSection.Donations(it)) }
add(CreatorChannelHomeSection.Donations(donations = channelDonations, isOwner = isOwner))
notices.takeIf { it.isNotEmpty() }?.let { add(CreatorChannelHomeSection.Notices(it)) }
schedules.sortedBy { it.scheduledAtUtc }.take(MAX_SCHEDULE_ITEM_COUNT)
.takeIf { it.isNotEmpty() }
@@ -35,7 +36,7 @@ fun CreatorChannelHomeResponse.toUiContent(currentMemberId: Long): CreatorChanne
isNotify = creator.isNotify,
isAiChatAvailable = creator.isAiChatAvailable,
isDmAvailable = creator.isDmAvailable,
isOwner = creator.creatorId == currentMemberId
isOwner = isOwner
),
tabs = CreatorChannelTab.entries,
sections = sections

View File

@@ -49,7 +49,10 @@ data class CreatorChannelHeaderUiModel(
sealed interface CreatorChannelHomeSection {
data class CurrentLive(val live: CreatorChannelLiveResponse) : CreatorChannelHomeSection
data class LatestAudioContent(val audioContent: CreatorChannelAudioContentResponse) : CreatorChannelHomeSection
data class Donations(val donations: List<CreatorChannelDonationResponse>) : CreatorChannelHomeSection
data class Donations(
val donations: List<CreatorChannelDonationResponse>,
val isOwner: Boolean
) : CreatorChannelHomeSection
data class Notices(val notices: List<CreatorChannelCommunityPostResponse>) : CreatorChannelHomeSection
data class Schedules(val schedules: List<CreatorChannelScheduleResponse>) : CreatorChannelHomeSection
data class AudioContents(val audioContents: List<CreatorChannelAudioContentResponse>) : CreatorChannelHomeSection