@@ -8,16 +8,19 @@ export default {
88
99const base_files = [
1010 {
11+ type : 'file' ,
1112 file_path : 'src/components/Button/Button.tsx' ,
1213 lines_added : 10 ,
1314 lines_removed : 2
1415 } ,
1516 {
17+ type : 'file' ,
1618 file_path : 'src/components/Input/Input.module.scss' ,
1719 lines_added : 5 ,
1820 lines_removed : 5
1921 } ,
2022 {
23+ type : 'file' ,
2124 file_path : 'src/utils/helpers.ts' ,
2225 lines_added : 20 ,
2326 lines_removed : 0
@@ -26,25 +29,29 @@ const base_files = [
2629
2730const files_using_fallbacks = [
2831 {
32+ type : 'file' ,
2933 file_path : 'src/new-feature.ts' ,
3034 is_new : true ,
3135 lines_added : 50 ,
3236 lines_removed : 0
3337 } ,
3438 {
39+ type : 'file' ,
3540 file_path : 'src/old-component.tsx' ,
3641 is_deleted : true ,
3742 lines_added : 0 ,
3843 lines_removed : 100
3944 } ,
4045 {
46+ type : 'file' ,
4147 file_path : 'src/complex-logic.js' ,
4248 is_fallback : true ,
4349 diff_fallback_method : 'recount' ,
4450 lines_added : 15 ,
4551 lines_removed : 12
4652 } ,
4753 {
54+ type : 'file' ,
4855 file_path : 'src/aggressive-fallback.css' ,
4956 is_fallback : true ,
5057 diff_fallback_method : 'search_and_replace' ,
@@ -62,7 +69,7 @@ const log_action =
6269const InteractiveResponsePreview = ( props : any ) => {
6370 const [ items , set_items ] = useState (
6471 props . items . map ( ( f : any ) =>
65- 'file_path' in f ? { ...f , is_checked : true } : f
72+ f . type == 'file' ? { ...f , is_checked : true } : f
6673 )
6774 )
6875
@@ -77,9 +84,9 @@ const InteractiveResponsePreview = (props: any) => {
7784 } ) => {
7885 set_items (
7986 items . map ( ( f : any ) =>
80- 'file_path' in f &&
81- f . file_path === file_path &&
82- f . workspace_name === workspace_name
87+ f . type == 'file' &&
88+ f . file_path == file_path &&
89+ f . workspace_name == workspace_name
8390 ? { ...f , is_checked }
8491 : f
8592 )
0 commit comments