import { useQuery } from '@apollo/client'
import Link from 'next/link'
import { getGetServerSideProps } from '../api/ssrApollo'
import Layout from '../components/layout'
import MoreFooter from '../components/more-footer'
import { WALLET_HISTORY } from '../fragments/wallet'
import styles from '../styles/satistics.module.css'
import Moon from '../svgs/moon-fill.svg'
import Check from '../svgs/check-double-line.svg'
import ThumbDown from '../svgs/thumb-down-fill.svg'
import { Checkbox, Form } from '../components/form'
import { useRouter } from 'next/router'
import Item from '../components/item'
import { CommentFlat } from '../components/comment'
import { Fragment } from 'react'
import ItemJob from '../components/item-job'
import PageLoading from '../components/page-loading'
export const getServerSideProps = getGetServerSideProps({ query: WALLET_HISTORY, authRequired: true })
function satusClass (status) {
if (!status) {
return ''
}
switch (status) {
case 'CONFIRMED':
return 'text-reset'
case 'PENDING':
return 'text-muted'
default:
return `${styles.failed} text-muted`
}
}
function Satus ({ status }) {
if (!status) {
return null
}
let color = 'danger'; let desc
switch (status) {
case 'CONFIRMED':
desc = 'confirmed'
color = 'success'
break
case 'EXPIRED':
desc = 'expired'
color = 'muted'
break
case 'PENDING':
desc = 'pending'
color = 'muted'
break
case 'INSUFFICIENT_BALANCE':
desc = "you didn't have enough sats"
break
case 'INVALID_PAYMENT':
desc = 'invalid payment'
break
case 'PATHFINDING_TIMEOUT':
case 'ROUTE_NOT_FOUND':
desc = 'no route found'
break
default:
return 'unknown failure'
}
const Icon = () => {
switch (status) {
case 'CONFIRMED':
return