@@ -27,7 +27,9 @@ export default function Items({ items, categories }: Props) {
2727 const [ selectedIds , setSelectedIds ] = useState < number [ ] > ( [ ] ) ;
2828 const [ percentage , setPercentage ] = useState < number > ( 0 ) ;
2929 const [ bulkCategory , setBulkCategory ] = useState < string > ( "" ) ;
30- const [ revertPreview , setRevertPreview ] = useState < PriceRevertPreviewItem [ ] | null > ( null ) ;
30+ const [ revertPreview , setRevertPreview ] = useState <
31+ PriceRevertPreviewItem [ ] | null
32+ > ( null ) ;
3133 const [ revertSelected , setRevertSelected ] = useState < Set < number > > ( new Set ( ) ) ;
3234 const [ previewLoading , setPreviewLoading ] = useState ( false ) ;
3335
@@ -192,21 +194,31 @@ export default function Items({ items, categories }: Props) {
192194 < div className = "w-full max-w-lg rounded-xl bg-white p-6 shadow-xl" >
193195 < h2 className = "mb-1 text-lg font-bold" > Revert Price Changes</ h2 >
194196 { revertPreview . length === 0 ? (
195- < p className = "py-4 text-sm text-gray-500" > No price changes found in version history.</ p >
197+ < p className = "py-4 text-sm text-gray-500" >
198+ No price changes found in version history.
199+ </ p >
196200 ) : (
197201 < >
198202 < p className = "mb-4 text-sm text-gray-500" >
199- { revertSelected . size } of { revertPreview . length } item{ revertPreview . length !== 1 ? "s" : "" } selected to revert:
203+ { revertSelected . size } of { revertPreview . length } item
204+ { revertPreview . length !== 1 ? "s" : "" } selected to revert:
200205 </ p >
201206 < div className = "max-h-72 overflow-y-auto rounded-lg border border-gray-200" >
202207 < table className = "w-full text-sm" >
203- < thead className = "sticky top-0 bg-gray-50 text-xs font-semibold uppercase text-gray-500" >
208+ < thead className = "sticky top-0 bg-gray-50 text-xs font-semibold text-gray-500 uppercase " >
204209 < tr >
205210 < th className = "px-3 py-2 text-left" >
206211 < input
207212 type = "checkbox"
208- checked = { revertSelected . size === revertPreview . length }
209- ref = { ( el ) => { if ( el ) el . indeterminate = revertSelected . size > 0 && revertSelected . size < revertPreview . length ; } }
213+ checked = {
214+ revertSelected . size === revertPreview . length
215+ }
216+ ref = { ( el ) => {
217+ if ( el )
218+ el . indeterminate =
219+ revertSelected . size > 0 &&
220+ revertSelected . size < revertPreview . length ;
221+ } }
210222 onChange = { toggleRevertAll }
211223 className = "cursor-pointer"
212224 />
@@ -233,8 +245,12 @@ export default function Items({ items, categories }: Props) {
233245 />
234246 </ td >
235247 < td className = "px-3 py-2" > { row . name } </ td >
236- < td className = "px-3 py-2 text-right text-gray-400" > { row . current_price } </ td >
237- < td className = "px-3 py-2 text-right font-medium text-green-700" > { row . revert_to } </ td >
248+ < td className = "px-3 py-2 text-right text-gray-400" >
249+ { row . current_price }
250+ </ td >
251+ < td className = "px-3 py-2 text-right font-medium text-green-700" >
252+ { row . revert_to }
253+ </ td >
238254 </ tr >
239255 ) ) }
240256 </ tbody >
0 commit comments