@@ -28,6 +28,7 @@ import { FieldChangeItem } from './FieldChangeItem';
2828import { ReactionPicker } from './ReactionPicker' ;
2929import { ThreadedReplies } from './ThreadedReplies' ;
3030import { SubscriptionToggle } from './SubscriptionToggle' ;
31+ import { useDetailTranslation } from './useDetailTranslation' ;
3132
3233export type FeedFilterMode = 'all' | 'comments_only' | 'changes_only' | 'tasks_only' ;
3334
@@ -81,12 +82,14 @@ const FEED_TYPE_COLORS: Record<FeedItemType, string> = {
8182 call : 'bg-teal-100 text-teal-600' ,
8283} ;
8384
84- const FILTER_OPTIONS : { value : FeedFilterMode ; label : string } [ ] = [
85- { value : 'all' , label : 'All Activity' } ,
86- { value : 'comments_only' , label : 'Comments Only' } ,
87- { value : 'changes_only' , label : 'Field Changes' } ,
88- { value : 'tasks_only' , label : 'Tasks Only' } ,
89- ] ;
85+ function getFilterOptions ( t : ( key : string ) => string ) : { value : FeedFilterMode ; label : string } [ ] {
86+ return [
87+ { value : 'all' , label : t ( 'detail.allActivity' ) } ,
88+ { value : 'comments_only' , label : t ( 'detail.commentsOnly' ) } ,
89+ { value : 'changes_only' , label : t ( 'detail.fieldChangesFilter' ) } ,
90+ { value : 'tasks_only' , label : t ( 'detail.tasksOnly' ) } ,
91+ ] ;
92+ }
9093
9194function formatTimestamp ( timestamp : string ) : string {
9295 try {
@@ -144,6 +147,7 @@ export const RecordActivityTimeline: React.FC<RecordActivityTimelineProps> = ({
144147 collapseWhenEmpty = false ,
145148 className,
146149} ) => {
150+ const { t } = useDetailTranslation ( ) ;
147151 const [ internalFilter , setInternalFilter ] = React . useState < FeedFilterMode > ( 'all' ) ;
148152 const [ commentText , setCommentText ] = React . useState ( '' ) ;
149153 const [ isSubmitting , setIsSubmitting ] = React . useState ( false ) ;
@@ -229,7 +233,7 @@ export const RecordActivityTimeline: React.FC<RecordActivityTimelineProps> = ({
229233 < div className = "flex items-center justify-between" >
230234 < CardTitle className = "flex items-center gap-2 text-base" >
231235 < Activity className = "h-4 w-4" />
232- Activity
236+ { t ( 'detail.activity' ) }
233237 < span className = "text-sm font-normal text-muted-foreground" >
234238 ({ filtered . length } )
235239 </ span >
@@ -254,7 +258,7 @@ export const RecordActivityTimeline: React.FC<RecordActivityTimelineProps> = ({
254258 onChange = { ( e ) => handleFilterChange ( e . target . value as FeedFilterMode ) }
255259 aria-label = "Filter activity"
256260 >
257- { FILTER_OPTIONS . map ( ( opt ) => (
261+ { getFilterOptions ( t ) . map ( ( opt ) => (
258262 < option key = { opt . value } value = { opt . value } >
259263 { opt . label }
260264 </ option >
@@ -268,7 +272,7 @@ export const RecordActivityTimeline: React.FC<RecordActivityTimelineProps> = ({
268272 < div className = "flex gap-2" >
269273 < textarea
270274 className = "flex-1 min-h-[60px] rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring resize-none"
271- placeholder = "Leave a comment… (Ctrl+Enter to submit)"
275+ placeholder = { t ( 'detail.leaveCommentPlaceholder' ) }
272276 value = { commentText }
273277 onChange = { ( e ) => setCommentText ( e . target . value ) }
274278 onKeyDown = { handleKeyDown }
@@ -291,7 +295,7 @@ export const RecordActivityTimeline: React.FC<RecordActivityTimelineProps> = ({
291295 { filtered . length === 0 ? (
292296 collapseWhenEmpty ? null : (
293297 < p className = "text-sm text-muted-foreground text-center py-4" >
294- No activity recorded
298+ { t ( 'detail.noActivity' ) }
295299 </ p >
296300 )
297301 ) : (
@@ -332,17 +336,17 @@ export const RecordActivityTimeline: React.FC<RecordActivityTimelineProps> = ({
332336 < span className = "text-sm font-medium" > { item . actor } </ span >
333337 { item . source && (
334338 < span className = "text-xs text-muted-foreground" >
335- via { item . source }
339+ { t ( 'detail. via' , { source : item . source } ) }
336340 </ span >
337341 ) }
338342 < span className = "text-xs text-muted-foreground" >
339343 { formatTimestamp ( item . createdAt ) }
340344 </ span >
341345 { item . edited && (
342- < span className = "text-xs text-muted-foreground italic" > ( edited) </ span >
346+ < span className = "text-xs text-muted-foreground italic" > { t ( 'detail. edited' ) } </ span >
343347 ) }
344348 { item . pinned && (
345- < span className = "text-xs text-amber-600" > 📌 Pinned </ span >
349+ < span className = "text-xs text-amber-600" > 📌 { t ( 'detail.pinned' ) } </ span >
346350 ) }
347351 </ div >
348352
@@ -419,7 +423,7 @@ export const RecordActivityTimeline: React.FC<RecordActivityTimelineProps> = ({
419423 ) : (
420424 < ChevronDown className = "h-4 w-4 mr-1" />
421425 ) }
422- Load more
426+ { t ( 'detail.loadMore' ) }
423427 </ Button >
424428 </ div >
425429 ) }
0 commit comments