Parcourir la source

feat: refactor billing display mode change handler in ColumnSelectorModal

CaIon il y a 1 mois
Parent
commit
63f4595ef8

+ 5 - 1
web/src/components/table/usage-logs/modals/ColumnSelectorModal.jsx

@@ -36,6 +36,10 @@ const ColumnSelectorModal = ({
   showUserInfoFunc,
   showUserInfoFunc,
   t,
   t,
 }) => {
 }) => {
+  const handleBillingDisplayModeChange = (eventOrValue) => {
+    setBillingDisplayMode(eventOrValue?.target?.value ?? eventOrValue);
+  };
+
   const isTokensDisplay =
   const isTokensDisplay =
     typeof localStorage !== 'undefined' &&
     typeof localStorage !== 'undefined' &&
     localStorage.getItem('quota_display_type') === 'TOKENS';
     localStorage.getItem('quota_display_type') === 'TOKENS';
@@ -73,7 +77,7 @@ const ColumnSelectorModal = ({
           <RadioGroup
           <RadioGroup
             type='button'
             type='button'
             value={billingDisplayMode}
             value={billingDisplayMode}
-            onChange={(value) => setBillingDisplayMode(value)}
+            onChange={handleBillingDisplayModeChange}
           >
           >
             <Radio value='price'>
             <Radio value='price'>
               {isTokensDisplay ? t('价格模式') : t('价格模式(默认)')}
               {isTokensDisplay ? t('价格模式') : t('价格模式(默认)')}