66 DialogTitle ,
77 DialogDescription ,
88} from "@/components/ui/dialog" ;
9+ import { useTranslation } from "react-i18next" ;
910
1011interface FileAttachmentTypeDialogProps {
1112 pendingFiles : File [ ] | null ;
@@ -18,6 +19,7 @@ export function FileAttachmentTypeDialog({
1819 onConfirm,
1920 onCancel,
2021} : FileAttachmentTypeDialogProps ) {
22+ const { t } = useTranslation ( "chat" ) ;
2123 const isOpen = ! ! pendingFiles && pendingFiles . length > 0 ;
2224 const fileCount = pendingFiles ?. length ?? 0 ;
2325
@@ -31,38 +33,47 @@ export function FileAttachmentTypeDialog({
3133 < DialogContent className = "sm:max-w-md" >
3234 < DialogHeader >
3335 < DialogTitle >
34- How would you like to attach{ " " }
35- { fileCount === 1 ? "this file" : `these ${ fileCount } files` } ?
36+ { fileCount === 1
37+ ? t ( "attachmentTypeDialog.titleSingular" )
38+ : t ( "attachmentTypeDialog.titlePlural" , { count : fileCount } ) }
3639 </ DialogTitle >
3740 < DialogDescription >
38- Choose how the { fileCount === 1 ? "file" : "files" } should be used.
41+ { fileCount === 1
42+ ? t ( "attachmentTypeDialog.descriptionSingular" )
43+ : t ( "attachmentTypeDialog.descriptionPlural" ) }
3944 </ DialogDescription >
4045 </ DialogHeader >
4146 < div className = "flex flex-col gap-2" >
4247 < button
43- className = "flex items-start gap-3 rounded-lg border border-border p-4 text-left hover:bg-muted/50 transition-colors"
48+ type = "button"
49+ className = "flex items-start gap-3 rounded-lg border border-border p-4 text-left hover:bg-muted/50 transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
4450 onClick = { ( ) => onConfirm ( "chat-context" ) }
4551 >
4652 < MessageSquare
4753 size = { 20 }
4854 className = "mt-0.5 text-green-500 flex-shrink-0"
4955 />
5056 < div >
51- < div className = "font-medium text-sm" > Attach as chat context</ div >
57+ < div className = "font-medium text-sm" >
58+ { t ( "attachFileContext" ) }
59+ </ div >
5260 < div className = "text-xs text-muted-foreground mt-0.5" >
53- Provide context for the AI (e.g. screenshots, references)
61+ { t ( "attachFileContextExample" ) }
5462 </ div >
5563 </ div >
5664 </ button >
5765 < button
58- className = "flex items-start gap-3 rounded-lg border border-border p-4 text-left hover:bg-muted/50 transition-colors"
66+ type = "button"
67+ className = "flex items-start gap-3 rounded-lg border border-border p-4 text-left hover:bg-muted/50 transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
5968 onClick = { ( ) => onConfirm ( "upload-to-codebase" ) }
6069 >
6170 < Upload size = { 20 } className = "mt-0.5 text-blue-500 flex-shrink-0" />
6271 < div >
63- < div className = "font-medium text-sm" > Upload to codebase</ div >
72+ < div className = "font-medium text-sm" >
73+ { t ( "uploadFileCodebase" ) }
74+ </ div >
6475 < div className = "text-xs text-muted-foreground mt-0.5" >
65- Add files to your project (e.g. images, assets)
76+ { t ( "uploadFileCodebaseExample" ) }
6677 </ div >
6778 </ div >
6879 </ button >
0 commit comments