1- " use client" ;
1+ ' use client' ;
22
3- import { useState , useRef } from "react" ;
4- import { api } from "~/trpc/react" ;
5- import { Button } from "~/components/ui/button" ;
3+ import { File , FileText , Loader2 , Upload } from 'lucide-react' ;
4+ import { useRef , useState } from 'react' ;
5+ import { Alert , AlertDescription } from '~/components/ui/alert' ;
6+ import { Button } from '~/components/ui/button' ;
67import {
78 Card ,
89 CardContent ,
910 CardDescription ,
1011 CardHeader ,
1112 CardTitle ,
12- } from "~/components/ui/card" ;
13- import { Alert , AlertDescription } from "~/components/ui/alert" ;
14- import { Loader2 , Upload , FileText , File } from "lucide-react" ;
13+ } from '~/components/ui/card' ;
14+ import { api } from '~/trpc/react' ;
1515
1616export default function ComponentWhitelistPage ( ) {
1717 const [ selectedFile , setSelectedFile ] = useState < File | null > ( null ) ;
@@ -32,7 +32,7 @@ export default function ComponentWhitelistPage() {
3232 setIsUploading ( false ) ;
3333 setSelectedFile ( null ) ;
3434 if ( fileInputRef . current ) {
35- fileInputRef . current . value = "" ;
35+ fileInputRef . current . value = '' ;
3636 }
3737 refetchStats ( ) ;
3838 } ,
@@ -49,12 +49,12 @@ export default function ComponentWhitelistPage() {
4949 const file = event . target . files ?. [ 0 ] ;
5050 if ( file ) {
5151 if (
52- file . type !== " text/csv" &&
53- ! file . name . toLowerCase ( ) . endsWith ( " .csv" )
52+ file . type !== ' text/csv' &&
53+ ! file . name . toLowerCase ( ) . endsWith ( ' .csv' )
5454 ) {
5555 setUploadResult ( {
5656 success : false ,
57- message : " Please select a CSV file" ,
57+ message : ' Please select a CSV file' ,
5858 } ) ;
5959 return ;
6060 }
@@ -70,9 +70,9 @@ export default function ComponentWhitelistPage() {
7070 } ;
7171
7272 const handleFileInputKeyDown = (
73- e : React . KeyboardEvent < HTMLButtonElement >
73+ e : React . KeyboardEvent < HTMLButtonElement > ,
7474 ) => {
75- if ( e . key === " Enter" || e . key === " " ) {
75+ if ( e . key === ' Enter' || e . key === ' ' ) {
7676 e . preventDefault ( ) ;
7777 fileInputRef . current ?. click ( ) ;
7878 }
@@ -82,7 +82,7 @@ export default function ComponentWhitelistPage() {
8282 if ( ! selectedFile ) {
8383 setUploadResult ( {
8484 success : false ,
85- message : " Please select a CSV file" ,
85+ message : ' Please select a CSV file' ,
8686 } ) ;
8787 return ;
8888 }
@@ -96,7 +96,7 @@ export default function ComponentWhitelistPage() {
9696 } catch ( error ) {
9797 setUploadResult ( {
9898 success : false ,
99- message : " Failed to read CSV file" ,
99+ message : ' Failed to read CSV file' ,
100100 } ) ;
101101 setIsUploading ( false ) ;
102102 }
@@ -129,7 +129,7 @@ export default function ComponentWhitelistPage() {
129129 < CardContent >
130130 < div >
131131 < p className = "text-2xl font-bold" >
132- { whitelistStats ?. count ?. toLocaleString ( ) ?? " Loading..." }
132+ { whitelistStats ?. count ?. toLocaleString ( ) ?? ' Loading...' }
133133 </ p >
134134 < p className = "text-muted-foreground" > Components in whitelist</ p >
135135 </ div >
@@ -219,7 +219,7 @@ export default function ComponentWhitelistPage() {
219219 e . stopPropagation ( ) ;
220220 setSelectedFile ( null ) ;
221221 if ( fileInputRef . current ) {
222- fileInputRef . current . value = "" ;
222+ fileInputRef . current . value = '' ;
223223 }
224224 setUploadResult ( null ) ;
225225 } }
@@ -253,7 +253,7 @@ export default function ComponentWhitelistPage() {
253253
254254 { /* Results */ }
255255 { uploadResult && (
256- < Alert variant = { uploadResult . success ? " default" : " destructive" } >
256+ < Alert variant = { uploadResult . success ? ' default' : ' destructive' } >
257257 < AlertDescription >
258258 { uploadResult . message }
259259 { uploadResult . count && (
0 commit comments