fix(conciliacion): muestra nombre del banco en select en lugar de ID
El SelectValue del proyecto solo muestra el value raw (el ID). Reemplazado por un span dentro de SelectTrigger que busca el banco seleccionado por su ID y muestra el nombre + terminacion.
This commit is contained in:
@@ -297,18 +297,27 @@ export default function ConciliacionPage() {
|
|||||||
{!isVisor && selected.size > 0 && (
|
{!isVisor && selected.size > 0 && (
|
||||||
<div className="sticky bottom-4 z-10 bg-card border rounded-lg shadow-lg p-4 flex items-center gap-4">
|
<div className="sticky bottom-4 z-10 bg-card border rounded-lg shadow-lg p-4 flex items-center gap-4">
|
||||||
<span className="text-sm font-medium">{selected.size} seleccionados</span>
|
<span className="text-sm font-medium">{selected.size} seleccionados</span>
|
||||||
<Select value={bancoId} onValueChange={setBancoId}>
|
{(() => {
|
||||||
<SelectTrigger className="w-48">
|
const selectedBank = bancos?.find((x) => String(x.id) === bancoId);
|
||||||
<SelectValue placeholder="Seleccionar banco" />
|
return (
|
||||||
</SelectTrigger>
|
<Select value={bancoId} onValueChange={setBancoId}>
|
||||||
<SelectContent>
|
<SelectTrigger className="w-48">
|
||||||
{bancos?.map((b) => (
|
<span className="truncate">
|
||||||
<SelectItem key={b.id} value={String(b.id)}>
|
{selectedBank
|
||||||
{b.banco} ****{b.terminacionCuenta}
|
? `${selectedBank.banco} ****${selectedBank.terminacionCuenta}`
|
||||||
</SelectItem>
|
: 'Seleccionar banco'}
|
||||||
))}
|
</span>
|
||||||
</SelectContent>
|
</SelectTrigger>
|
||||||
</Select>
|
<SelectContent>
|
||||||
|
{bancos?.map((b) => (
|
||||||
|
<SelectItem key={b.id} value={String(b.id)}>
|
||||||
|
{b.banco} ****{b.terminacionCuenta}
|
||||||
|
</SelectItem>
|
||||||
|
))}
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
);
|
||||||
|
})()}
|
||||||
<Input
|
<Input
|
||||||
type="date"
|
type="date"
|
||||||
value={fechaPago}
|
value={fechaPago}
|
||||||
|
|||||||
Reference in New Issue
Block a user