Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/app/components/search/SearchResultsSorter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,30 @@

import React from 'react';
import { ChevronDown } from 'lucide-react';
import { useInternationalization } from '@/hooks/useInternationalization';

interface SearchResultsSorterProps {
value: string;
onChange: (value: string) => void;
}

export const SearchResultsSorter: React.FC<SearchResultsSorterProps> = ({ value, onChange }) => {
const { t } = useInternationalization();

return (
<div className="flex items-center gap-3">
<span className="text-xs font-mono text-slate-500 uppercase">Sort_Sequence:</span>
<span className="text-xs font-mono text-slate-500 uppercase">{t('search.sortSequence')}</span>
<div className="relative">
<select
value={value}
onChange={(e) => onChange(e.target.value)}
className="bg-[#0a1120] border border-primary/30 text-primary text-sm pl-4 pr-10 py-2 focus:ring-1 focus:ring-primary focus:border-primary clip-corner appearance-none font-mono cursor-pointer hover:bg-primary/5 transition-colors"
>
<option value="popularity">POPULARITY</option>
<option value="newest">NEWEST_FIRST</option>
<option value="price_asc">PRICE_ASC</option>
<option value="price_desc">PRICE_DESC</option>
<option value="rating">RATING_HIGH</option>
<option value="popularity">{t('search.sort.popularity')}</option>
<option value="newest">{t('search.sort.newest')}</option>
<option value="price_asc">{t('search.sort.priceAsc')}</option>
<option value="price_desc">{t('search.sort.priceDesc')}</option>
<option value="rating">{t('search.sort.rating')}</option>
</select>
<ChevronDown className="absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-primary pointer-events-none" />
</div>
Expand Down
10 changes: 10 additions & 0 deletions src/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -328,5 +328,15 @@
}
}
}
},
"search": {
"sortSequence": "ترتيب حسب:",
"sort": {
"popularity": "حسب الشعبية",
"newest": "الأحدث أولاً",
"priceAsc": "السعر: من الأقل للأعلى",
"priceDesc": "السعر: من الأعلى للأقل",
"rating": "الأعلى تقييمًا"
}
}
}
10 changes: 10 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -328,5 +328,15 @@
}
}
}
},
"search": {
"sortSequence": "Sort By:",
"sort": {
"popularity": "Sort by Relevance",
"newest": "Newest First",
"priceAsc": "Price: Low to High",
"priceDesc": "Price: High to Low",
"rating": "Highest Rated"
}
}
}
10 changes: 10 additions & 0 deletions src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -328,5 +328,15 @@
}
}
}
},
"search": {
"sortSequence": "Ordenar por:",
"sort": {
"popularity": "Popularidad",
"newest": "Más recientes",
"priceAsc": "Precio: Menor a Mayor",
"priceDesc": "Precio: Mayor a Menor",
"rating": "Mejor valorados"
}
}
}
Loading