diff --git a/index.html b/index.html index 299a3f1..58642a2 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + PDF Splitter diff --git a/public/vite.svg b/public/pdf.svg similarity index 100% rename from public/vite.svg rename to public/pdf.svg diff --git a/src/assets/react.svg b/src/assets/react.svg deleted file mode 100644 index 6c87de9..0000000 --- a/src/assets/react.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/components/container.tsx b/src/components/container.tsx index 1ac9ab1..753d953 100644 --- a/src/components/container.tsx +++ b/src/components/container.tsx @@ -5,7 +5,7 @@ interface ContainerProps { } const Container: FC = ({ children }) => { - return
{children}
; + return
{children}
; }; export default Container; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index c53e3ea..0a2ddbd 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -6,19 +6,15 @@ export const Home = () => { const [file, setFile] = useState(); const [numOfPages, setNumOfPages] = useState(); const [doc, setDoc] = useState(); - const [loading, setLoading] = useState(false); const [splitter, setSplitter] = useState(['']); - const [message, setMessage] = useState(''); useEffect(() => { if (!file) { setDoc(undefined); return; } - setLoading(true); file.arrayBuffer().then(async (buff) => { setDoc(await PDFDocument.load(buff)); - setLoading(false); }); }, [file]); @@ -72,10 +68,10 @@ export const Home = () => { }; return ( -
+

PDF Splitter

-
Upload PDF File
+
Upload PDF File
{ onChange={handleFileChange} /> {} -
+
Pages Count: {numOfPages}
- Split Pages - (Separated by comma, ex: 1, 2, 5-10, 14) + Split Pages + (Separated by comma, ex: 1, 2, 5-10, 14)
{splitter.map((val, idx) => { return (
-
-
{`Split #${idx + 1}`}
+
+
{`Split #${idx + 1}`}
{ @@ -114,10 +110,10 @@ export const Home = () => { placeholder="Pages number" /> {idx === 0 ? ( - <> +
) : (
-
+
-
{message}
); };