11import { FC , useState , useMemo } from 'react'
22import { FileInReview } from '@shared/types/file-in-review'
33import cn from 'classnames'
4- import styles from './Changes .module.scss'
4+ import styles from './ResponseReview .module.scss'
55import { Button } from '../Button'
66import { Checkbox } from '../Checkbox'
77import { IconButton } from '../IconButton/IconButton'
88
99type Props = {
1010 files : ( FileInReview & { is_checked : boolean } ) [ ]
1111 has_multiple_workspaces : boolean
12- on_undo : ( ) => void
13- on_keep : ( files : FileInReview [ ] ) => void
12+ on_discard : ( ) => void
13+ on_approve : ( files : FileInReview [ ] ) => void
1414 on_focus_file : ( file : { file_path : string ; workspace_name ?: string } ) => void
1515 on_go_to_file : ( file : { file_path : string ; workspace_name ?: string } ) => void
1616 on_intelligent_update : ( file : {
@@ -25,11 +25,11 @@ type Props = {
2525 raw_instructions ?: string
2626}
2727
28- export const Changes : FC < Props > = ( {
28+ export const ResponseReview : FC < Props > = ( {
2929 files,
3030 has_multiple_workspaces,
31- on_undo ,
32- on_keep ,
31+ on_discard ,
32+ on_approve ,
3333 on_focus_file,
3434 on_go_to_file,
3535 on_toggle_file,
@@ -38,9 +38,9 @@ export const Changes: FC<Props> = ({
3838} ) => {
3939 const [ last_clicked_file_index , set_last_clicked_file_index ] = useState ( 0 )
4040
41- const handle_keep = ( ) => {
41+ const handle_approve = ( ) => {
4242 const accepted_files = files . filter ( ( f ) => f . is_checked )
43- on_keep ( accepted_files )
43+ on_approve ( accepted_files )
4444 }
4545
4646 const fallback_count = files . filter ( ( f ) => f . is_fallback ) . length
@@ -200,17 +200,16 @@ export const Changes: FC<Props> = ({
200200 } ) }
201201 </ div >
202202 < div className = { styles . footer } >
203- < Button on_click = { on_undo } is_secondary >
204- < span className = "codicon codicon-redo" />
205-
206- { files . length > 1 ? 'Discard All' : 'Discard' }
203+ < Button on_click = { on_discard } is_secondary >
204+ < span className = "codicon codicon-close" />
205+ Discard
207206 </ Button >
208207 < Button
209- on_click = { handle_keep }
208+ on_click = { handle_approve }
210209 disabled = { files . filter ( ( f ) => f . is_checked ) . length == 0 }
211210 >
212211 < span className = "codicon codicon-check" />
213- { files . length > 1 ? ' Approve Selected' : 'Approve' }
212+ Approve
214213 </ Button >
215214 </ div >
216215 </ div >
0 commit comments