shoc-frontend-new/src/constants.js
Adam Moussa ec8cca86d1 Configure frontend for local development
- Use relative API URLs instead of hardcoded production/localhost URLs
- Fix setupProxy.js for http-proxy-middleware v3 syntax
- Point proxy to backend HTTP port for dev compatibility
2026-04-16 16:25:19 -04:00

29 lines
798 B
JavaScript

export const ADD = "add";
export const EDIT = "edit";
export const API_ERROR_MESSAGE =
"Sorry, something went wrong. Please try again later.";
export const API_SUCCESS_MESSAGE =
"You changes has been successfully saved.";
export const API_DELETE_SUCCESS_MESSAGE =
"Item is deleted";
export const API_URL = process.env.REACT_APP_API_URL || "/api";
export const form_text_builder = (mode) => {
let PRIMARY_TEXT = "";
let SECONDARY_TEXT = "";
let BUTTON_TEXT = "";
if (mode == ADD) {
PRIMARY_TEXT = "Add an Item";
SECONDARY_TEXT = "Add your new item below";
BUTTON_TEXT = "Add Item";
} else {
PRIMARY_TEXT = "Edit an Item";
SECONDARY_TEXT = "Edit your item below";
BUTTON_TEXT = "Save Item";
}
return { PRIMARY_TEXT, SECONDARY_TEXT, BUTTON_TEXT };
};