Files
react-training/hotel-management/src/constants/commons.ts
T
2023-12-04 09:00:00 +07:00

70 lines
1.1 KiB
TypeScript

const USER_PAGE = {
SORTBY_OPTIONS: [
{
value: 'id',
label: 'Sort by id',
},
{
value: 'name',
label: 'Sort by name',
},
{
value: 'phone',
label: 'Sort by phone',
},
],
};
const ORDERBY_OPTIONS = [
{
value: 'asc',
label: 'Ascending',
},
{
value: 'desc',
label: 'Descending',
},
];
const ROOM_PAGE = {
SORTBY_OPTIONS: [
{
value: 'id',
label: 'Sort by id',
},
{
value: 'name',
label: 'Sort by name',
},
{
value: 'price',
label: 'Sort by price',
},
],
};
const FORM = {
EDIT: 'edit',
DELETE: 'delete',
USER: 'user-form',
ROOM: 'room-form',
BOOKING: 'booking-form',
CHECKOUT: 'checkout',
};
const REGEX = {
PHONE: /(0[3|5|7|8|9])+([0-9]{8})\b/g,
NAME: /^[a-zA-Z]{2,}(?: [a-zA-Z]+){0,2}$/gm,
NUMBER: /^[0-9]*$/,
PASSWORD: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[#$@!%&*?])[A-Za-z\d#$@!%&*?]{8,16}$/,
EMAIL: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
};
export {
USER_PAGE,
ROOM_PAGE,
FORM,
REGEX,
ORDERBY_OPTIONS
};