-
Notifications
You must be signed in to change notification settings - Fork 131
fix(frontend): resolve typecheck and lint errors #674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -219,40 +219,39 @@ export function DelegationCard({ | |
| </div> | ||
|
|
||
| <LimitUsageBar | ||
| spent={0n} cap={delegation.policy.maxTotal} periodRollover={delegation.policy.expiresAt} | ||
| currency={currencyId as any} | ||
| rate={rate} | ||
| spent={0n} | ||
| cap={delegation.policy.maxTotal} | ||
| periodRollover={delegation.policy.expiresAt} | ||
| /> | ||
|
|
||
| {editing ? ( | ||
| <div className="delegation-card-edit-form"> | ||
| <div className="form-group"> | ||
| <label className="form-label">Max per transaction</label> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Associate each visible label with its input. Line 230 and Line 238 render standalone Also applies to: 238-238 🤖 Prompt for AI Agents |
||
| <StroopsInput | ||
| label="Max per transaction" | ||
| value={maxPerTransaction} | ||
| onChange={setMaxPerTransaction} | ||
| disabled={saving} | ||
| /> | ||
| </div> | ||
| <div className="form-group"> | ||
| <label className="form-label">Max total budget</label> | ||
| <StroopsInput | ||
| label="Max total budget" | ||
| value={maxTotal} | ||
| onChange={setMaxTotal} | ||
| disabled={saving} | ||
| /> | ||
| </div> | ||
|
|
||
| <MerchantWhitelistPicker | ||
| allowedMerchants={allowedMerchants} | ||
| value={allowedMerchants} | ||
| onChange={setAllowedMerchants} | ||
|
Comment on lines
+247
to
+248
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Disable merchant edits while the policy save is pending.
🤖 Prompt for AI Agents |
||
| unrestricted={unrestrictedMerchants} | ||
| onAllowedMerchantsChange={setAllowedMerchants} | ||
| onUnrestrictedChange={(unrestricted) => { | ||
| setUnrestrictedMerchants(unrestricted); | ||
| if (unrestricted) setShowEmptyWhitelistError(false); | ||
| }} | ||
| showEmptyError={showEmptyWhitelistError} | ||
| disabled={saving} | ||
| showEmptyWhitelistError={showEmptyWhitelistError} | ||
| /> | ||
|
|
||
| <div className="delegation-card-edit-actions"> | ||
|
|
@@ -281,15 +280,15 @@ export function DelegationCard({ | |
| <Amount | ||
| stroops={delegation.policy.maxPerTransaction} | ||
| currency={currencyId as any} | ||
| rate={rate} | ||
| xlmUsdRate={rate?.xlmUsdRate} | ||
| /> | ||
| </div> | ||
| <div className="policy-summary-row"> | ||
| <span>Total budget limit:</span> | ||
| <Amount | ||
| stroops={delegation.policy.maxTotal} | ||
| currency={currencyId as any} | ||
| rate={rate} | ||
| xlmUsdRate={rate?.xlmUsdRate} | ||
| /> | ||
| </div> | ||
| <div className="policy-summary-row"> | ||
|
|
@@ -362,15 +361,19 @@ export function DelegationCard({ | |
|
|
||
| {showQr && ( | ||
| <div className="mt-4 p-3 bg-slate-50 dark:bg-slate-900 rounded border"> | ||
| <DelegationQR delegation={delegation} /> | ||
| <DelegationQR | ||
| delegationId={delegation.id} | ||
| userId={delegation.userId} | ||
| agentId={delegation.agentId} | ||
| /> | ||
| </div> | ||
| )} | ||
| </Card> | ||
|
|
||
| {showPauseModal && ( | ||
| <PauseResumeConfirmModal | ||
| isOpen={showPauseModal} | ||
| isPaused={isPaused} | ||
| action={isPaused ? "resume" : "pause"} | ||
| agentId={delegation.agentId} | ||
| onConfirm={handleConfirmPauseToggle} | ||
| onCancel={() => setShowPauseModal(false)} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: DelegoLabs/Delego
Length of output: 2990
🏁 Script executed:
Repository: DelegoLabs/Delego
Length of output: 2221
🌐 Web query:
Recharts 2.15.0 Tooltip content callback type TooltipProps source💡 Result:
In Recharts 2.15.0, the
contentprop for theTooltipcomponent is typed asContentType<TValue, TName>[1][2]. This type allows you to pass either a React element or a function to customize the tooltip's rendering [3][2]. TheContentTypeis defined as follows: Type = React.ReactElement | ((props: TooltipContentProps<TValue, TName>) => React.ReactNode); When using a function (a render prop) for thecontentprop, it receives an object containing the tooltip's context and data (often referred to in community discussions asTooltipContentProps) [2][4]. This function should return HTML elements, not SVG elements [3][2]. If thecontentprop is not provided, Recharts defaults to using the internalDefaultTooltipContentcomponent [3][2]. If a React element is passed, Recharts clones that element and injects the tooltip's props into it [3][2]. Please note that in Recharts 3.x, the internal type handling and props passed to custom content were updated, which occasionally creates confusion when referencing older 2.x documentation or community discussions [5][4][6]. For version 2.15.0 specifically, you should rely on the type definitions available in the 2.15.0 package [1][7].Citations:
🏁 Script executed:
Repository: DelegoLabs/Delego
Length of output: 2478
🏁 Script executed:
Repository: DelegoLabs/Delego
Length of output: 611
Keep the tooltip callback typed.
Line 76 disables TypeScript checks for the props passed to
SpendTooltip. Use RechartsTooltipProps<number, string>instead ofany.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents