11<script setup lang="ts">
2- import { FilterIcon , SearchIcon , SortAscIcon , SortDescIcon , XIcon } from ' @modrinth/assets'
3- import { Button , DropdownSelect , Pagination } from ' @modrinth/ui'
2+ import {
3+ FilterIcon ,
4+ SearchIcon ,
5+ ShieldAlertIcon ,
6+ SortAscIcon ,
7+ SortDescIcon ,
8+ XIcon ,
9+ } from ' @modrinth/assets'
10+ import { Button , ButtonStyled , DropdownSelect , Pagination } from ' @modrinth/ui'
411import { defineMessages , useVIntl } from ' @vintl/vintl'
512import Fuse from ' fuse.js'
613import BatchScanProgressAlert , {
@@ -9,14 +16,11 @@ import BatchScanProgressAlert, {
916import ModerationTechRevCard from ' ~/components/ui/moderation/ModerationTechRevCard.vue'
1017import { fetchDelphiIssues , fetchIssueTypeSchema , type OrderBy } from ' ~/helpers/tech-review'
1118
12- // Data from backend helper (with dummy fallback)
1319type TechReviewItem = Awaited <ReturnType <typeof fetchDelphiIssues >>[number ]
1420const reviewItems = ref <TechReviewItem []>([])
1521
16- // Basic pagination state (mirrors moderation pages)
1722const currentPage = ref (1 )
1823const itemsPerPage = 15
19- // Search/filter/sort UI state
2024const { formatMessage } = useVIntl ()
2125const route = useRoute ()
2226const router = useRouter ()
@@ -158,7 +162,6 @@ function goToPage(page: number) {
158162 currentPage .value = page
159163}
160164
161- // Map sort label to backend order_by param
162165function toOrderBy(label : string ): OrderBy | null {
163166 switch (label ) {
164167 case ' Oldest' :
@@ -176,7 +179,6 @@ function toOrderBy(label: string): OrderBy | null {
176179 }
177180}
178181
179- // Initial fetch and reactive refetch on filter/sort changes
180182onMounted (async () => {
181183 rawIssueTypes .value = await fetchIssueTypeSchema ()
182184 const order_by = toOrderBy (currentSortType .value )
@@ -193,7 +195,6 @@ watch(currentFilterType, async (val) => {
193195watch (currentSortType , async (val ) => {
194196 const type = currentFilterType .value === ' All issues' ? null : currentFilterType .value
195197 const order_by = toOrderBy (val )
196- // If you prefer server-side sorting only, keep this; otherwise client-side above already reorders
197198 reviewItems .value = await fetchDelphiIssues ({ type , count: 350 , offset: 0 , order_by })
198199 goToPage (1 )
199200})
@@ -264,26 +265,24 @@ const batchScanProgressInformation = computed<BatchScanProgress | undefined>(()
264265 <span class =" truncate" >{{ selected }}</span >
265266 </span >
266267 </DropdownSelect >
268+
269+ <ButtonStyled color =" orange" >
270+ <button ><ShieldAlertIcon /> Batch scan</button >
271+ </ButtonStyled >
267272 </div >
268273 </div >
269274
270275 <div v-if =" totalPages > 1" class =" flex justify-center lg:hidden" >
271276 <Pagination :page =" currentPage" :count =" totalPages" @switch-page =" goToPage" />
272277 </div >
273278
274- <div class =" flex flex-col gap-2 " >
279+ <div class =" flex flex-col gap-4 " >
275280 <div v-if =" paginatedItems.length === 0" class =" universal-card h-24 animate-pulse" ></div >
276- <div
277- v-else
278- v-for =" (item, idx) in paginatedItems"
279- :key =" item.issue.id ?? idx"
280- class =" "
281- >
281+ <div v-else v-for =" (item, idx) in paginatedItems" :key =" item.issue.id ?? idx" class =" " >
282282 <ModerationTechRevCard :item =" item" />
283283 </div >
284284 </div >
285285
286- <!-- Bottom pagination -->
287286 <div v-if =" totalPages > 1" class =" mt-4 flex justify-center" >
288287 <Pagination :page =" currentPage" :count =" totalPages" @switch-page =" goToPage" />
289288 </div >
0 commit comments