@@ -6,11 +6,11 @@ interface SearchHistoryItem {
66
77const MAX_ITEMS = 8
88
9- const DEFAULT_CATEGORIES : QuickCategoryItem [ ] = [
10- { category : 'restaurant' , label : 'Restaurant' , icon : 'i-tabler:tools-kitchen-2' , color : 'orange' } ,
11- { category : 'cafe' , label : 'Cafe' , icon : 'i-tabler:coffee' , color : 'gold' } ,
12- { category : 'bar' , label : 'Bar' , icon : 'i-tabler:beer' , color : 'green' } ,
13- { category : 'pharmacy' , label : 'Pharmacy' , icon : 'i-tabler:pill' , color : 'purple' } ,
9+ const DEFAULT_CATEGORY_IDS = [
10+ { category : 'restaurant' , icon : 'i-tabler:tools-kitchen-2' , color : 'orange' as const } ,
11+ { category : 'cafe' , icon : 'i-tabler:coffee' , color : 'gold' as const } ,
12+ { category : 'bar' , icon : 'i-tabler:beer' , color : 'green' as const } ,
13+ { category : 'pharmacy' , icon : 'i-tabler:pill' , color : 'purple' as const } ,
1414]
1515
1616export function useSearchHistory ( ) {
@@ -36,7 +36,12 @@ export function useSearchHistory() {
3636 } )
3737
3838 const remaining = 4 - historyItems . length
39- const defaults = DEFAULT_CATEGORIES . slice ( 0 , remaining )
39+ const defaults = DEFAULT_CATEGORY_IDS . slice ( 0 , remaining ) . map ( ( { category, icon, color } ) : QuickCategoryItem => ( {
40+ category,
41+ label : formatCategoryLabel ( category ) ,
42+ icon,
43+ color,
44+ } ) )
4045 return [ ...historyItems , ...defaults ]
4146 }
4247
0 commit comments