2025-08-23 23:28:21 +05:30
|
|
|
import { useState } from 'react'
|
2025-09-18 14:36:59 +02:00
|
|
|
import { FeeLimitDialog } from '@/components/settings/FeeLimitDialog'
|
2025-08-23 23:28:21 +05:30
|
|
|
import { Button } from '@/components/ui/button'
|
|
|
|
|
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
|
2026-01-07 12:43:48 +01:00
|
|
|
import { FeeConfigErrorAlert } from '@/components/ui/jam/FeeConfigErrorAlert'
|
2025-09-18 14:36:59 +02:00
|
|
|
import type { WalletFileName } from '@/lib/utils'
|
2025-08-23 23:28:21 +05:30
|
|
|
|
2025-09-18 14:36:59 +02:00
|
|
|
interface FeeConfigTestComponentProps {
|
|
|
|
|
walletFileName: WalletFileName
|
|
|
|
|
}
|
|
|
|
|
export const FeeConfigTestComponent = ({ walletFileName }: FeeConfigTestComponentProps) => {
|
2025-08-23 23:28:21 +05:30
|
|
|
const [showFeeConfigDialog, setShowFeeConfigDialog] = useState(false)
|
|
|
|
|
const [forceError, setForceError] = useState(false)
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Card className="border-2 border-dashed border-yellow-500 bg-yellow-50 dark:bg-yellow-900/20">
|
|
|
|
|
<CardHeader>
|
|
|
|
|
<CardTitle className="text-yellow-700 dark:text-yellow-300">🧪 Fee Config Error Test Component</CardTitle>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent className="space-y-4">
|
|
|
|
|
<p className="text-sm text-yellow-600 dark:text-yellow-400">
|
|
|
|
|
This component allows you to test the fee config error handling.
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<div className="flex gap-2">
|
|
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
|
|
|
|
size="sm"
|
|
|
|
|
onClick={() => setForceError(!forceError)}
|
|
|
|
|
className="border-yellow-500 text-yellow-700 hover:bg-yellow-100 dark:text-yellow-300 dark:hover:bg-yellow-800"
|
|
|
|
|
>
|
|
|
|
|
{forceError ? 'Hide Error' : 'Show Error'}
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
|
|
|
|
size="sm"
|
|
|
|
|
onClick={() => setShowFeeConfigDialog(true)}
|
|
|
|
|
className="border-blue-500 text-blue-700 hover:bg-blue-100 dark:text-blue-300 dark:hover:bg-blue-800"
|
|
|
|
|
>
|
|
|
|
|
Open Fee Config Dialog
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Force Error Display */}
|
|
|
|
|
{forceError && <FeeConfigErrorAlert onOpenFeeConfig={() => setShowFeeConfigDialog(true)} className="mt-4" />}
|
|
|
|
|
|
|
|
|
|
{/* Fee Configuration Dialog */}
|
|
|
|
|
<FeeLimitDialog
|
|
|
|
|
open={showFeeConfigDialog}
|
|
|
|
|
onOpenChange={setShowFeeConfigDialog}
|
2025-09-18 14:36:59 +02:00
|
|
|
walletFileName={walletFileName}
|
2025-08-23 23:28:21 +05:30
|
|
|
/>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
)
|
|
|
|
|
}
|