fixed a lot of lint and work on utils

This commit is contained in:
Boki 2025-06-19 21:07:37 -04:00
parent 4881a38c32
commit 42bc2966df
17 changed files with 183 additions and 93 deletions

View file

@ -278,9 +278,9 @@ export function PortfolioTable() {
size: 120,
cell: ({ getValue }) => {
const value = getValue() as number;
if (value >= 1e12) return <span className="font-mono">${(value / 1e12).toFixed(2)}T</span>;
if (value >= 1e9) return <span className="font-mono">${(value / 1e9).toFixed(2)}B</span>;
if (value >= 1e6) return <span className="font-mono">${(value / 1e6).toFixed(2)}M</span>;
if (value >= 1e12) {return <span className="font-mono">${(value / 1e12).toFixed(2)}T</span>;}
if (value >= 1e9) {return <span className="font-mono">${(value / 1e9).toFixed(2)}B</span>;}
if (value >= 1e6) {return <span className="font-mono">${(value / 1e6).toFixed(2)}M</span>;}
return <span className="font-mono">${value.toLocaleString()}</span>;
},
},
@ -327,8 +327,8 @@ export function PortfolioTable() {
size: 120,
cell: ({ getValue }) => {
const value = getValue() as number;
if (value >= 1e9) return <span className="font-mono">${(value / 1e9).toFixed(2)}B</span>;
if (value >= 1e6) return <span className="font-mono">${(value / 1e6).toFixed(2)}M</span>;
if (value >= 1e9) {return <span className="font-mono">${(value / 1e9).toFixed(2)}B</span>;}
if (value >= 1e6) {return <span className="font-mono">${(value / 1e6).toFixed(2)}M</span>;}
return <span className="font-mono">${value.toLocaleString()}</span>;
},
},
@ -339,8 +339,8 @@ export function PortfolioTable() {
size: 120,
cell: ({ getValue }) => {
const value = getValue() as number;
if (value >= 1e9) return <span className="font-mono">${(value / 1e9).toFixed(2)}B</span>;
if (value >= 1e6) return <span className="font-mono">${(value / 1e6).toFixed(2)}M</span>;
if (value >= 1e9) {return <span className="font-mono">${(value / 1e9).toFixed(2)}B</span>;}
if (value >= 1e6) {return <span className="font-mono">${(value / 1e6).toFixed(2)}M</span>;}
return <span className="font-mono">${value.toLocaleString()}</span>;
},
},

View file

@ -200,7 +200,7 @@ export function AddProviderMappingDialog({
const exchange = unmappedExchanges.find(
ex => ex.provider_exchange_code === selectedProviderExchange
);
if (!exchange) return null;
if (!exchange) {return null;}
return (
<div className="space-y-1 text-xs">

View file

@ -27,7 +27,7 @@ export function AddSourceDialog({
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
if (!source || !sourceCode || !id || !name || !code) return;
if (!source || !sourceCode || !id || !name || !code) {return;}
setLoading(true);
try {
@ -52,8 +52,8 @@ export function AddSourceDialog({
setName('');
setCode('');
setAliases('');
} catch (error) {
console.error('Error adding source:', error);
} catch (_error) {
console.error('Error adding source:', _error);
} finally {
setLoading(false);
}

View file

@ -35,7 +35,7 @@ export function useFormValidation<T>(
onSuccess?: () => void,
onError?: (error: unknown) => void
) => {
if (!validate()) return;
if (!validate()) {return;}
setIsSubmitting(true);
try {