added location total to UI
This commit is contained in:
@@ -5,18 +5,12 @@ import { AddLocationButton } from './ui/AddLocationButton';
|
||||
import { PageFooter } from './ui/PageFooter';
|
||||
import { isAuthErrorMessage } from '@/app/lib/auth';
|
||||
import { fetchAllLocations } from './lib/locationActions';
|
||||
import { formatCurrency } from './lib/formatStrings';
|
||||
|
||||
const getNextYearMonth = (yearMonth:number) => {
|
||||
return(yearMonth % 100 === 12 ? yearMonth + 89 : yearMonth + 1);
|
||||
}
|
||||
|
||||
const formatCurrency = (amount:number) => {
|
||||
// format number wirh 2 decimal places and a thousand separator
|
||||
const formattedAmount = amount.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
|
||||
return(formattedAmount);
|
||||
}
|
||||
|
||||
|
||||
export const Page = async () => {
|
||||
|
||||
const locations = await fetchAllLocations();
|
||||
|
||||
Reference in New Issue
Block a user