@@ -5,11 +5,11 @@ import {
55 gt ,
66 makeSchemaWithDefaults ,
77 regex ,
8+ makeCellWithRegexSorter ,
89} from "./shared" ;
910import { EC2Instance , PricingUnit , CostDuration , Pricing } from "@/types" ;
1011import RegionLinkPreloader from "@/components/RegionLinkPreloader" ;
1112import sortByInstanceType from "../sortByInstanceType" ;
12- import { makeCellWithRegexSorter } from "./ec2/columns" ;
1313
1414const initialColumnsArr = [
1515 [ "pretty_name" , true ] ,
@@ -136,7 +136,7 @@ export const columnsGen = (
136136 id : "cost-ondemand-redis" ,
137137 header : "Redis Cost" ,
138138 sortingFn : "alphanumeric" ,
139- ...makeCellWithRegexSorter ( ( info ) => {
139+ ...makeCellWithRegexSorter ( "pricing" , ( info ) => {
140140 const pricing = info . getValue ( ) as Pricing ;
141141 const region = pricing [ selectedRegion ] ;
142142 if ( ! region ) return "N/A" ;
@@ -153,7 +153,7 @@ export const columnsGen = (
153153 id : "cost-reserved-redis" ,
154154 header : "Redis Reserved Cost" ,
155155 sortingFn : "alphanumeric" ,
156- ...makeCellWithRegexSorter ( ( info ) => {
156+ ...makeCellWithRegexSorter ( "pricing" , ( info ) => {
157157 const pricing = info . getValue ( ) as Pricing ;
158158 const region = pricing [ selectedRegion ] ;
159159 if ( ! region ) return "N/A" ;
@@ -170,7 +170,7 @@ export const columnsGen = (
170170 id : "cost-ondemand-memcached" ,
171171 header : "Memcached On Demand Cost" ,
172172 sortingFn : "alphanumeric" ,
173- ...makeCellWithRegexSorter ( ( info ) => {
173+ ...makeCellWithRegexSorter ( "pricing" , ( info ) => {
174174 const pricing = info . getValue ( ) as Pricing ;
175175 const region = pricing [ selectedRegion ] ;
176176 if ( ! region ) return "N/A" ;
@@ -187,7 +187,7 @@ export const columnsGen = (
187187 id : "cost-reserved-memcached" ,
188188 header : "Memcached Reserved Cost" ,
189189 sortingFn : "alphanumeric" ,
190- ...makeCellWithRegexSorter ( ( info ) => {
190+ ...makeCellWithRegexSorter ( "pricing" , ( info ) => {
191191 const pricing = info . getValue ( ) as Pricing ;
192192 const region = pricing [ selectedRegion ] ;
193193 if ( ! region ) return "N/A" ;
@@ -204,7 +204,7 @@ export const columnsGen = (
204204 id : "cost-ondemand-valkey" ,
205205 header : "Valkey On Demand Cost" ,
206206 sortingFn : "alphanumeric" ,
207- ...makeCellWithRegexSorter ( ( info ) => {
207+ ...makeCellWithRegexSorter ( "pricing" , ( info ) => {
208208 const pricing = info . getValue ( ) as Pricing ;
209209 const region = pricing [ selectedRegion ] ;
210210 if ( ! region ) return "N/A" ;
@@ -221,7 +221,7 @@ export const columnsGen = (
221221 id : "cost-reserved-valkey" ,
222222 header : "Valkey Reserved Cost" ,
223223 sortingFn : "alphanumeric" ,
224- ...makeCellWithRegexSorter ( ( info ) => {
224+ ...makeCellWithRegexSorter ( "pricing" , ( info ) => {
225225 const pricing = info . getValue ( ) as Pricing ;
226226 const region = pricing [ selectedRegion ] ;
227227 if ( ! region ) return "N/A" ;
@@ -238,17 +238,10 @@ export const columnsGen = (
238238 id : "generation" ,
239239 header : "Generation" ,
240240 sortingFn : "alphanumeric" ,
241- filterFn : regex ( {
242- getCell : ( row ) => {
243- // @ts -expect-error: Not typed
244- const v = row . original . currentGeneration ;
245- if ( v === "Yes" ) return "current" ;
246- return "previous" ;
247- } ,
248- } ) ,
249- cell : ( info ) => {
241+ // @ts -expect-error: This accessor is not typed right now.
242+ ...makeCellWithRegexSorter ( "currentGeneration" , ( info ) => {
250243 if ( info . getValue ( ) === "Yes" ) return "current" ;
251244 return "previous" ;
252- } ,
245+ } ) ,
253246 } ,
254247] ;
0 commit comments