feat(17-01): wire ChatMainContent with real discussion view (GREEN)
- Replace ChatMainContent() stub with ChatMainContent(data DiscussionTabData) - Renders .ui-card container with .message-own/.message-other rows and .message-bubble - Update GetChatPage handler to pass views.NewDiscussionTabData() - Run templ generate; TestChatMainContentRendersBubbleClasses passes - Full go test ./... -count=1 exits 0
This commit is contained in:
parent
dd1133d7cc
commit
81ccaeb107
3 changed files with 413 additions and 279 deletions
|
|
@ -128,7 +128,7 @@ func (h *AuthHandler) GetPlanningPage() http.HandlerFunc {
|
||||||
|
|
||||||
func (h *AuthHandler) GetChatPage() http.HandlerFunc {
|
func (h *AuthHandler) GetChatPage() http.HandlerFunc {
|
||||||
return h.renderAppPage("/chat", func(user PublicUser) templ.Component {
|
return h.renderAppPage("/chat", func(user PublicUser) templ.Component {
|
||||||
return views.ChatMainContent()
|
return views.ChatMainContent(views.NewDiscussionTabData())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -163,8 +163,36 @@ templ PlanningMainContent() {
|
||||||
@AppSectionMainContent("Planning", "Visualisez le rythme de l'équipe, les jalons à venir et les arbitrages de charge.")
|
@AppSectionMainContent("Planning", "Visualisez le rythme de l'équipe, les jalons à venir et les arbitrages de charge.")
|
||||||
}
|
}
|
||||||
|
|
||||||
templ ChatMainContent() {
|
templ ChatMainContent(data DiscussionTabData) {
|
||||||
@AppSectionMainContent("Discussions", "Retrouvez les conversations importantes, les décisions récentes et les échanges à relancer.")
|
<div id="discussion-messages" class="ui-card">
|
||||||
|
if len(data.Messages) == 0 {
|
||||||
|
@ui.EmptyState(ui.EmptyStateProps{
|
||||||
|
Title: "No messages yet",
|
||||||
|
Description: "Start the discussion.",
|
||||||
|
Icon: ui.UIIcon("message-circle"),
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
for _, msg := range data.Messages {
|
||||||
|
if msg.IsOwn {
|
||||||
|
<div class="message-row message-own">
|
||||||
|
<div class="message-meta">
|
||||||
|
<span class="message-author">{ msg.Author }</span>
|
||||||
|
<span>{ msg.Timestamp }</span>
|
||||||
|
</div>
|
||||||
|
<div class="message-bubble">{ msg.Body }</div>
|
||||||
|
</div>
|
||||||
|
} else {
|
||||||
|
<div class="message-row message-other">
|
||||||
|
<div class="message-meta">
|
||||||
|
<span class="message-author">{ msg.Author }</span>
|
||||||
|
<span>{ msg.Timestamp }</span>
|
||||||
|
</div>
|
||||||
|
<div class="message-bubble">{ msg.Body }</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
templ FilesMainContent() {
|
templ FilesMainContent() {
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue