forked from cartsnitch/cartsnitch
6b6b9e7d01
Add formatCurrency, formatDate, and storeSlugs utilities in src/utils/ with 21 vitest unit tests covering standard and edge cases. Co-Authored-By: Paperclip <noreply@paperclip.ing>
14 lines
530 B
TypeScript
14 lines
530 B
TypeScript
export const STORE_SLUGS: Record<string, { name: string; color: string; icon: string }> = {
|
|
meijer: { name: 'Meijer', color: '#e31837', icon: '/icons/stores/meijer.svg' },
|
|
kroger: { name: 'Kroger', color: '#0033a0', icon: '/icons/stores/kroger.svg' },
|
|
target: { name: 'Target', color: '#cc0000', icon: '/icons/stores/target.svg' },
|
|
};
|
|
|
|
export function getStore(slug: string) {
|
|
return STORE_SLUGS[slug.toLowerCase()] ?? null;
|
|
}
|
|
|
|
export function getStoreName(slug: string): string {
|
|
return getStore(slug)?.name ?? slug;
|
|
}
|