From f66b12fd1d0b83af0d7230d7b1565fbe00afbe3c Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 22 Feb 2023 11:03:34 +0700 Subject: prettier --- src/lib/invoice/components/Invoices.jsx | 175 ++++++++++++++++---------------- 1 file changed, 88 insertions(+), 87 deletions(-) (limited to 'src/lib/invoice/components/Invoices.jsx') diff --git a/src/lib/invoice/components/Invoices.jsx b/src/lib/invoice/components/Invoices.jsx index 37944e33..81521785 100644 --- a/src/lib/invoice/components/Invoices.jsx +++ b/src/lib/invoice/components/Invoices.jsx @@ -1,23 +1,25 @@ -import { CheckIcon, ClockIcon, EllipsisVerticalIcon, MagnifyingGlassIcon } from "@heroicons/react/24/outline" -import { toQuery } from "lodash-contrib" -import _ from "lodash" -import { useRouter } from "next/router" -import { useState } from "react" -import useInvoices from "../hooks/useInvoices" -import Spinner from "@/core/components/elements/Spinner/Spinner" -import Alert from "@/core/components/elements/Alert/Alert" -import Pagination from "@/core/components/elements/Pagination/Pagination" -import Link from "@/core/components/elements/Link/Link" -import currencyFormat from "@/core/utils/currencyFormat" -import BottomPopup from "@/core/components/elements/Popup/BottomPopup" -import { downloadInvoice, downloadTaxInvoice } from "../utils/invoices" +import { + CheckIcon, + ClockIcon, + EllipsisVerticalIcon, + MagnifyingGlassIcon +} from '@heroicons/react/24/outline' +import { toQuery } from 'lodash-contrib' +import _ from 'lodash' +import { useRouter } from 'next/router' +import { useState } from 'react' +import useInvoices from '../hooks/useInvoices' +import Spinner from '@/core/components/elements/Spinner/Spinner' +import Alert from '@/core/components/elements/Alert/Alert' +import Pagination from '@/core/components/elements/Pagination/Pagination' +import Link from '@/core/components/elements/Link/Link' +import currencyFormat from '@/core/utils/currencyFormat' +import BottomPopup from '@/core/components/elements/Popup/BottomPopup' +import { downloadInvoice, downloadTaxInvoice } from '../utils/invoices' const Invoices = () => { const router = useRouter() - const { - q = '', - page = 1 - } = router.query + const { q = '', page = 1 } = router.query const limit = 10 @@ -28,8 +30,8 @@ const Invoices = () => { } const { invoices } = useInvoices({ query }) - const [ inputQuery, setInputQuery ] = useState(q) - const [ toOthers, setToOthers ] = useState(null) + const [inputQuery, setInputQuery] = useState(q) + const [toOthers, setToOthers] = useState(null) const pageCount = Math.ceil(invoices?.data?.saleOrderTotal / limit) let pageQuery = _.omit(query, ['limit', 'offset']) @@ -39,112 +41,111 @@ const Invoices = () => { const handleSubmit = (e) => { e.preventDefault() router.push(`/my/invoices?q=${inputQuery}`) - } + } return ( -
-
- + + setInputQuery(e.target.value)} /> -
- { invoices.isLoading && ( -
- + {invoices.isLoading && ( +
+
- ) } + )} - { !invoices.isLoading && invoices.data?.invoices?.length === 0 && ( - + {!invoices.isLoading && invoices.data?.invoices?.length === 0 && ( + Tidak ada data invoice - ) } + )} - { invoices.data?.invoices?.map((invoice, index) => ( -
-
+ {invoices.data?.invoices?.map((invoice, index) => ( +
+
- No. Invoice -

{ invoice.name }

+ No. Invoice +

{invoice.name}

-
- { invoice.amountResidual > 0 ? ( -
Belum Lunas
- ) : ( -
Lunas
- ) } - setToOthers(invoice)} /> +
+ {invoice.amountResidual > 0 ? ( +
Belum Lunas
+ ) : ( +
Lunas
+ )} + setToOthers(invoice)} />
-
-

- { invoice.invoiceDate } -

-

- { invoice.paymentTerm } -

+
+

{invoice.invoiceDate}

+

{invoice.paymentTerm}

-
-
+
+
- No. Purchase Order -

{ invoice.purchaseOrderName || '-' }

+ No. Purchase Order +

+ {invoice.purchaseOrderName || '-'} +

-
- Total Invoice -

{ currencyFormat(invoice.amountTotal) }

+
+ Total Invoice +

+ {currencyFormat(invoice.amountTotal)} +

- { invoice.efaktur ? ( -
- + {invoice.efaktur ? ( +
+ Faktur Pajak
- ) : ( -
- + ) : ( +
+ Faktur Pajak
- ) } + )}
- )) } + ))} - setToOthers(null)} - > -
- - @@ -154,4 +155,4 @@ const Invoices = () => { ) } -export default Invoices \ No newline at end of file +export default Invoices -- cgit v1.2.3