@@ -598,25 +598,34 @@ export function Table() {
598598 setRenamingColumn ( null )
599599 return
600600 }
601- updateColumnMutation . mutate ( { columnName : renamingColumn , updates : { name : renameValue . trim ( ) } } )
601+ updateColumnMutation . mutate ( {
602+ columnName : renamingColumn ,
603+ updates : { name : renameValue . trim ( ) } ,
604+ } )
602605 setRenamingColumn ( null )
603606 } , [ renamingColumn , renameValue ] )
604607
605608 const handleChangeType = useCallback ( ( columnName : string , newType : string ) => {
606609 updateColumnMutation . mutate ( { columnName, updates : { type : newType } } )
607610 } , [ ] )
608611
609- const handleInsertColumnLeft = useCallback ( ( columnName : string ) => {
610- const index = columnsRef . current . findIndex ( ( c ) => c . name === columnName )
611- if ( index === - 1 ) return
612- addColumnMutation . mutate ( { name : generateColumnName ( ) , type : 'string' , position : index } )
613- } , [ generateColumnName ] )
612+ const handleInsertColumnLeft = useCallback (
613+ ( columnName : string ) => {
614+ const index = columnsRef . current . findIndex ( ( c ) => c . name === columnName )
615+ if ( index === - 1 ) return
616+ addColumnMutation . mutate ( { name : generateColumnName ( ) , type : 'string' , position : index } )
617+ } ,
618+ [ generateColumnName ]
619+ )
614620
615- const handleInsertColumnRight = useCallback ( ( columnName : string ) => {
616- const index = columnsRef . current . findIndex ( ( c ) => c . name === columnName )
617- if ( index === - 1 ) return
618- addColumnMutation . mutate ( { name : generateColumnName ( ) , type : 'string' , position : index + 1 } )
619- } , [ generateColumnName ] )
621+ const handleInsertColumnRight = useCallback (
622+ ( columnName : string ) => {
623+ const index = columnsRef . current . findIndex ( ( c ) => c . name === columnName )
624+ if ( index === - 1 ) return
625+ addColumnMutation . mutate ( { name : generateColumnName ( ) , type : 'string' , position : index + 1 } )
626+ } ,
627+ [ generateColumnName ]
628+ )
620629
621630 const handleToggleUnique = useCallback ( ( columnName : string ) => {
622631 const column = columnsRef . current . find ( ( c ) => c . name === columnName )
@@ -683,7 +692,6 @@ export function Table() {
683692 [ columnOptions , activeSortState , handleSortChange , handleSortClear ]
684693 )
685694
686-
687695 if ( ! isLoadingTable && ! tableData ) {
688696 return (
689697 < div className = 'flex h-full items-center justify-center' >
@@ -970,8 +978,8 @@ export function Table() {
970978 < ModalBody >
971979 < p className = 'text-[13px] text-[var(--text-secondary)]' >
972980 Are you sure you want to delete{ ' ' }
973- < span className = 'font-medium text-[var(--text-primary)]' > { deletingColumn } </ span > ?
974- This will remove all data in this column.{ ' ' }
981+ < span className = 'font-medium text-[var(--text-primary)]' > { deletingColumn } </ span > ? This
982+ will remove all data in this column.{ ' ' }
975983 < span className = 'text-[var(--text-error)]' > This action cannot be undone.</ span >
976984 </ p >
977985 </ ModalBody >
0 commit comments