@@ -5,7 +5,13 @@ import { useMemo, useRef, useState } from "react";
55import { useRealtimeRun , useRealtimeStream } from "@trigger.dev/react-hooks" ;
66import { Streamdown } from "streamdown" ;
77import { ArrowLeft , AlertCircle , Calendar , Copy , Check } from "lucide-react" ;
8- import { Card , CardContent , CardHeader , CardTitle } from "@/components/ui/card" ;
8+ import {
9+ Card ,
10+ CardContent ,
11+ CardFooter ,
12+ CardHeader ,
13+ CardTitle ,
14+ } from "@/components/ui/card" ;
915import { Button } from "@/components/ui/button" ;
1016import { Alert , AlertDescription } from "@/components/ui/alert" ;
1117import { changelogStream } from "@/trigger/changelog-stream" ;
@@ -48,7 +54,7 @@ function parseChangelogSections(
4854 sections . push ( {
4955 title : currentTitle ,
5056 content,
51- category : currentCategory || undefined ,
57+ category : currentCategory || "Update" ,
5258 date,
5359 } ) ;
5460 }
@@ -64,7 +70,7 @@ function parseChangelogSections(
6470 sections . push ( {
6571 title : currentTitle ,
6672 content,
67- category : currentCategory || undefined ,
73+ category : currentCategory || "Update" ,
6874 date,
6975 } ) ;
7076 }
@@ -73,10 +79,10 @@ function parseChangelogSections(
7379}
7480
7581function extractDate ( content : string ) : { content : string ; date ?: string } {
76- const dateMatch = content . match ( / \[ D A T E : \s * ( [ ^ \] ] + ) \] \s * $ / ) ;
82+ const dateMatch = content . match ( / \[ D A T E : \s * ( [ ^ \] ] + ) \] / ) ;
7783 if ( dateMatch ) {
7884 return {
79- content : content . replace ( / \[ D A T E : \s * [ ^ \] ] + \] \s * $ / , "" ) . trim ( ) ,
85+ content : content . replace ( / \[ D A T E : \s * [ ^ \] ] + \] \s * / , "" ) . trim ( ) ,
8086 date : dateMatch [ 1 ] . trim ( ) ,
8187 } ;
8288 }
@@ -187,7 +193,7 @@ export default function ResponsePage() {
187193 </ Button >
188194
189195 < h1 className = "text-2xl font-bold tracking-tight" >
190- Changelog entries
196+ Generated changelogs
191197 </ h1 >
192198 </ header >
193199
@@ -270,19 +276,10 @@ export default function ResponsePage() {
270276 < Card key = { i } >
271277 < CardHeader className = "flex gap-4" >
272278 < div className = "flex items-center w-full justify-between gap-4 shrink-0" >
273- { ( section . category || section . date ) && (
274- < div className = "gap-3 flex items-center" >
275- { section . category && (
276- < span className = "text-xs font-medium text-muted-foreground bg-secondary px-2 py-0.5 rounded" >
277- { section . category }
278- </ span >
279- ) }
280- { section . date && (
281- < span className = "text-xs text-muted-foreground" >
282- { section . date }
283- </ span >
284- ) }
285- </ div >
279+ { section . category && (
280+ < span className = "text-xs font-medium text-muted-foreground bg-secondary px-2 py-0.5 rounded" >
281+ { section . category }
282+ </ span >
286283 ) }
287284
288285 < Button
@@ -316,6 +313,13 @@ export default function ResponsePage() {
316313 { section . content }
317314 </ Streamdown >
318315 </ CardContent >
316+ { section . date && (
317+ < CardFooter className = "pt-4 border-t border-border" >
318+ < span className = "text-xs text-muted-foreground" >
319+ { section . date }
320+ </ span >
321+ </ CardFooter >
322+ ) }
319323 </ Card >
320324 ) ) }
321325
0 commit comments