feat: 💨
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
import { formatAmount, getAmountFromInvoice } from '@/lib/lightning'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { useNostr } from '@/providers/NostrProvider'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { useToast } from '@/hooks'
|
||||
import { Loader, Zap } from 'lucide-react'
|
||||
import { formatAmount, getAmountFromInvoice } from '@/lib/lightning'
|
||||
import { useNostr } from '@/providers/NostrProvider'
|
||||
import lightning from '@/services/lightning.service'
|
||||
import { Loader, Zap } from 'lucide-react'
|
||||
import { useMemo, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Button } from '@/components/ui/button'
|
||||
|
||||
export function EmbeddedLNInvoice({ invoice }: { invoice: string }) {
|
||||
const { t } = useTranslation()
|
||||
@@ -47,37 +46,19 @@ export function EmbeddedLNInvoice({ invoice }: { invoice: string }) {
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
'border rounded-lg p-4 bg-card text-card-foreground shadow-sm',
|
||||
'flex flex-col gap-3 my-2 max-w-sm'
|
||||
)}
|
||||
className="p-2 sm:p-3 border rounded-lg cursor-default flex flex-col gap-3 max-w-sm"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
<div className="flex items-center gap-2">
|
||||
<Zap className="w-5 h-5 text-yellow-500" />
|
||||
<h3 className="font-semibold text-sm">Lightning Invoice</h3>
|
||||
<Zap className="w-5 h-5 text-yellow-400" />
|
||||
<div className="font-semibold text-sm">{t('Lightning Invoice')}</div>
|
||||
</div>
|
||||
<div className="text-lg font-bold">
|
||||
{formatAmount(amount)}
|
||||
{formatAmount(amount)} {t('sats')}
|
||||
</div>
|
||||
<Button
|
||||
className={cn(
|
||||
'w-full px-4 py-2 rounded-md font-medium text-sm',
|
||||
'bg-purple-600 hover:bg-purple-700 text-white',
|
||||
'disabled:opacity-50 disabled:cursor-not-allowed',
|
||||
'transition-colors duration-200',
|
||||
'flex items-center justify-center gap-2'
|
||||
)}
|
||||
onClick={handlePayClick}
|
||||
>
|
||||
{paying ? (
|
||||
<>
|
||||
<Loader className="w-4 h-4 animate-spin" />
|
||||
Paying...
|
||||
</>
|
||||
) : (
|
||||
'Pay'
|
||||
)}
|
||||
<Button onClick={handlePayClick}>
|
||||
{paying && <Loader className="w-4 h-4 animate-spin" />}
|
||||
{t('Pay')}
|
||||
</Button>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -239,6 +239,7 @@ export default {
|
||||
'Followed by': 'متابع من قبل',
|
||||
'Mute user privately': 'كتم المستخدم بشكل خاص',
|
||||
'Mute user publicly': 'كتم المستخدم علنياً',
|
||||
Quotes: 'الاقتباسات'
|
||||
Quotes: 'الاقتباسات',
|
||||
'Lightning Invoice': 'فاتورة Lightning'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,6 +246,7 @@ export default {
|
||||
'Followed by': 'Gefolgt von',
|
||||
'Mute user privately': 'Benutzer privat stummschalten',
|
||||
'Mute user publicly': 'Benutzer öffentlich stummschalten',
|
||||
Quotes: 'Zitate'
|
||||
Quotes: 'Zitate',
|
||||
'Lightning Invoice': 'Lightning-Rechnung'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,6 +239,7 @@ export default {
|
||||
'Followed by': 'Followed by',
|
||||
'Mute user privately': 'Mute user privately',
|
||||
'Mute user publicly': 'Mute user publicly',
|
||||
Quotes: 'Quotes'
|
||||
Quotes: 'Quotes',
|
||||
'Lightning Invoice': 'Lightning Invoice'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,6 +244,7 @@ export default {
|
||||
'Followed by': 'Seguidos por',
|
||||
'Mute user privately': 'Silenciar usuario en privado',
|
||||
'Mute user publicly': 'Silenciar usuario públicamente',
|
||||
Quotes: 'Citas'
|
||||
Quotes: 'Citas',
|
||||
'Lightning Invoice': 'Factura Lightning'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,6 +244,7 @@ export default {
|
||||
'Followed by': 'Suivi par',
|
||||
'Mute user privately': 'Mettre l’utilisateur en sourdine en privé',
|
||||
'Mute user publicly': 'Mettre l’utilisateur en sourdine publiquement',
|
||||
Quotes: 'Citations'
|
||||
Quotes: 'Citations',
|
||||
'Lightning Invoice': 'Facture Lightning'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,6 +243,7 @@ export default {
|
||||
'Followed by': 'Seguito da',
|
||||
'Mute user privately': 'Zittisci utente privatamente',
|
||||
'Mute user publicly': 'Zittisci utente pubblicamente',
|
||||
Quotes: 'Citazioni'
|
||||
Quotes: 'Citazioni',
|
||||
'Lightning Invoice': 'Fattura Lightning'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,6 +240,7 @@ export default {
|
||||
'Followed by': 'フォロワー',
|
||||
'Mute user privately': 'ユーザーを非公開でミュート',
|
||||
'Mute user publicly': 'ユーザーを公開でミュート',
|
||||
Quotes: '引用'
|
||||
Quotes: '引用',
|
||||
'Lightning Invoice': 'ライトニングインボイス'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,6 +242,7 @@ export default {
|
||||
'Followed by': 'Obserwowany przez',
|
||||
'Mute user privately': 'Zablokuj użytkownika prywatnie',
|
||||
'Mute user publicly': 'Zablokuj użytkownika publicznie',
|
||||
Quotes: 'Cytaty'
|
||||
Quotes: 'Cytaty',
|
||||
'Lightning Invoice': 'Faktura Lightning'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,6 +242,7 @@ export default {
|
||||
'Followed by': 'Seguido por',
|
||||
'Mute user privately': 'Silenciar usuário privadamente',
|
||||
'Mute user publicly': 'Silenciar usuário publicamente',
|
||||
Quotes: 'Citações'
|
||||
Quotes: 'Citações',
|
||||
'Lightning Invoice': 'Fatura Lightning'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,6 +243,7 @@ export default {
|
||||
'Followed by': 'Seguido por',
|
||||
'Mute user privately': 'Silenciar usuário privadamente',
|
||||
'Mute user publicly': 'Silenciar usuário publicamente',
|
||||
Quotes: 'Citações'
|
||||
Quotes: 'Citações',
|
||||
'Lightning Invoice': 'Fatura Lightning'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,6 +244,7 @@ export default {
|
||||
'Followed by': 'Подписан на',
|
||||
'Mute user privately': 'Заглушить пользователя приватно',
|
||||
'Mute user publicly': 'Заглушить пользователя публично',
|
||||
Quotes: 'Цитаты'
|
||||
Quotes: 'Цитаты',
|
||||
'Lightning Invoice': 'Lightning-счет'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,6 +240,7 @@ export default {
|
||||
'Followed by': '关注者',
|
||||
'Mute user privately': '悄悄屏蔽',
|
||||
'Mute user publicly': '公开屏蔽',
|
||||
Quotes: '引用'
|
||||
Quotes: '引用',
|
||||
'Lightning Invoice': '闪电发票'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user