fix(expenses): no help line for "Företaget" in the Vem betalade select (#2330)
The button under it already says "Matcha mot transaktion", so the line "Kort eller bankkonto. Matchas mot transaktionen när den syns." repeated it. The other answers keep their line: it names the liability the company takes on. Claude-Session: https://claude.ai/code/session_01P8YsvPqjfGxGZUkGeBVUWQ Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Jakob Wennberg
Claude Fable 5.1
parent
c0eda46354
commit
0ecf1d7fc4
@@ -3116,8 +3116,16 @@ export function PayerChoiceSelect({
|
||||
accountingMethod: AccountingMethod
|
||||
}) {
|
||||
const t = useTranslations('inbox_workspace')
|
||||
const helpKey = (choice: PayerChoice): string =>
|
||||
choice === 'unpaid' && accountingMethod === 'cash' ? 'payer_help_unpaid_cash' : `payer_help_${choice}`
|
||||
// Företaget carries no help line: the button under it ("Matcha mot
|
||||
// transaktion") already says what happens. The other answers name the
|
||||
// liability the company takes on, which is the consequence worth reading.
|
||||
const helpKey = (choice: PayerChoice): string | null =>
|
||||
choice === 'company'
|
||||
? null
|
||||
: choice === 'unpaid' && accountingMethod === 'cash'
|
||||
? 'payer_help_unpaid_cash'
|
||||
: `payer_help_${choice}`
|
||||
const selectedHelp = helpKey(value)
|
||||
return (
|
||||
<div className="space-y-1.5">
|
||||
<p className="text-[13px] font-medium">{t('payer_question')}</p>
|
||||
@@ -3133,12 +3141,14 @@ export function PayerChoiceSelect({
|
||||
{PAYER_ORDER.map((choice) => (
|
||||
<SelectItem key={choice} value={choice} className="py-2">
|
||||
<span className="block text-[13px]">{t(`payer_${choice}`)}</span>
|
||||
<span className="block text-xs text-muted-foreground">{t(helpKey(choice))}</span>
|
||||
{helpKey(choice) && (
|
||||
<span className="block text-xs text-muted-foreground">{t(helpKey(choice)!)}</span>
|
||||
)}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<p className="text-xs text-muted-foreground">{t(helpKey(value))}</p>
|
||||
{selectedHelp && <p className="text-xs text-muted-foreground">{t(selectedHelp)}</p>}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -3304,7 +3304,6 @@
|
||||
"inbox_workspace": {
|
||||
"payer_question": "Who paid?",
|
||||
"payer_company": "The company",
|
||||
"payer_help_company": "Card or bank account. Matched against the transaction when it appears.",
|
||||
"payer_owner": "Me, privately",
|
||||
"payer_help_owner": "The company owes you the amount. Paid out from the company account later.",
|
||||
"payer_employee": "An employee",
|
||||
|
||||
@@ -3304,7 +3304,6 @@
|
||||
"inbox_workspace": {
|
||||
"payer_question": "Vem betalade?",
|
||||
"payer_company": "Företaget",
|
||||
"payer_help_company": "Kort eller bankkonto. Matchas mot transaktionen när den syns.",
|
||||
"payer_owner": "Jag, privat",
|
||||
"payer_help_owner": "Bolaget blir skyldigt dig beloppet. Betalas ut från företagskontot senare.",
|
||||
"payer_employee": "En anställd",
|
||||
|
||||
Reference in New Issue
Block a user