Skip to content
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

Fixes en Simulacion #214

Merged
merged 16 commits into from
Apr 8, 2024
Merged
42 changes: 35 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"lucide-react": "^0.363.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-number-format": "^5.3.4",
"tailwind-merge": "^2.2.2",
"tailwindcss": "3.4.1",
"tailwindcss-animate": "^1.0.7",
Expand Down
70 changes: 70 additions & 0 deletions src/components/SimularInvestment/Onboarding.constants.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import { formatCurrency, formatPercentage } from 'src/utils/formats';

interface Option {
value: string;
label: string;
}

interface InvestmentConfig {
meses: {
label: string;
options: Option[];
info: string;
};
dias: {
label: string;
options: Option[];
info: string;
};
}

export const investmentConfig: InvestmentConfig = {
meses: {
label: 'Plazo de inversión (mínimo 1 mes)',
options: [
{ value: '1', label: '1 Mes' },
{ value: '2', label: '2 Meses' },
{ value: '3', label: '3 Meses' },
{ value: '6', label: '6 Meses' },
{ value: '12', label: '12 Meses' },
],
info: '* Los rendimientos se calculan en base a una reinversión mensual de un plazo fijo a 30 días. La tasa puede variar constantemente.',
},
dias: {
label: 'Plazo de inversión (mínimo 30 días)',
options: [
{ value: '30', label: '30 Días' },
{ value: '60', label: '60 Días' },
{ value: '90', label: '90 Días' },
],
info: '* Los rendimientos se calculan en base a la variación del último día. La tasa puede variar constantemente.',
},
};

interface InvestmentField {
key: string;
label: string;
formatter?: (value: number) => string;
}

export const investmentFields: InvestmentField[] = [
{
key: 'monto',
label: 'Monto a invertir',
formatter: (value) => formatCurrency(value),
},
{
key: 'plazo',
label: 'Plazo',
},
{
key: 'tna',
label: 'TNA',
formatter: (value) => formatPercentage(value),
},
{
key: 'tea',
label: 'TEA',
formatter: (value) => formatPercentage(value),
},
];
Loading
Loading