Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
finwise-miniapp-fe
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ThinhNC
finwise-miniapp-fe
Commits
d4793d80
Commit
d4793d80
authored
Oct 07, 2026
by
ThinhNC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(ocr): consolidate duplicate warning boxes into a single unified disclaimer card
parent
150d32cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
17 deletions
+25
-17
ReceiptScannerView.tsx
src/pages/ai-assistant/components/ReceiptScannerView.tsx
+25
-17
No files found.
src/pages/ai-assistant/components/ReceiptScannerView.tsx
View file @
d4793d80
...
...
@@ -181,6 +181,17 @@ export const ReceiptScannerView: React.FC<ReceiptScannerViewProps> = ({ onTransa
return
trimmed
;
};
const
standardWarningTexts
=
[
"please verify extracted values against the original receipt before creating a transaction."
,
"vui lòng đối chiếu các giá trị đã trích xuất với hóa đơn gốc trước khi tạo giao dịch."
,
];
const
specificWarnings
=
Array
.
isArray
(
extractedData
?.
warnings
)
?
extractedData
.
warnings
.
filter
(
(
w
)
=>
!
standardWarningTexts
.
includes
(
w
.
trim
().
toLowerCase
())
)
:
[];
return
(
<
div
className=
"flex flex-col gap-5 px-2 pb-4 pt-2"
>
<
section
className=
"text-center"
>
...
...
@@ -400,24 +411,21 @@ export const ReceiptScannerView: React.FC<ReceiptScannerViewProps> = ({ onTransa
</
details
>
)
}
{
/* Warnings */
}
{
Array
.
isArray
(
extractedData
.
warnings
)
&&
extractedData
.
warnings
.
length
>
0
&&
(
<
div
className=
"mt-4 rounded-clay-sm bg-clay-warning/10 p-3 border border-clay-warning/30 text-xs font-medium text-clay-text space-y-1"
>
<
span
className=
"block font-bold text-clay-warning"
>
{
t
(
"ai.ocr.warnings"
)
}
:
</
span
>
{
extractedData
.
warnings
.
map
((
warn
,
i
)
=>
(
<
p
key=
{
i
}
>
•
{
localizeWarning
(
warn
)
}
</
p
>
))
}
{
/* AI Accuracy Disclaimer & Warnings */
}
<
div
className=
"mt-4 rounded-xl border border-clay-warning/30 bg-clay-warning/10 p-3 text-left"
>
<
div
className=
"flex items-start gap-2.5"
>
<
AlertTriangleIcon
size=
{
16
}
className=
"shrink-0 text-clay-warning mt-0.5"
/>
<
p
className=
"font-nunito text-xs text-clay-text-muted leading-relaxed"
>
{
t
(
"ai.ocr.disclaimer"
)
}
</
p
>
</
div
>
)
}
{
/* AI Accuracy Disclaimer Notice */
}
<
div
className=
"mt-4 flex items-center gap-2 rounded-xl border border-clay-warning/30 bg-clay-warning/10 p-2.5 px-3 text-left"
>
<
AlertTriangleIcon
size=
{
15
}
className=
"shrink-0 text-clay-warning"
/>
<
p
className=
"font-nunito text-[11px] text-clay-text-muted leading-tight"
>
{
t
(
"ai.ocr.disclaimer"
)
}
</
p
>
{
specificWarnings
.
length
>
0
&&
(
<
div
className=
"mt-2 pt-2 border-t border-clay-warning/20 font-nunito text-[11px] text-clay-text-muted space-y-1 pl-6"
>
{
specificWarnings
.
map
((
warn
,
i
)
=>
(
<
p
key=
{
i
}
>
•
{
localizeWarning
(
warn
)
}
</
p
>
))
}
</
div
>
)
}
</
div
>
{
/* Confirm Create Transaction Action */
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment