|
|
|
import { useEffect, useState } from 'react';
|
|
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 产品管理 相关的预设数据
|
|
|
|
*/
|
|
|
|
|
|
|
|
export const useProductsTypes = () => {
|
|
|
|
const [types, setTypes] = useState([]);
|
|
|
|
const { t, i18n } = useTranslation();
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
const newData = [
|
|
|
|
{ label: t('products:type.Experience'), value: 'Experience', key: 'Experience' },
|
|
|
|
{ label: t('products:type.Car'), value: 'Car', key: 'Car' },
|
|
|
|
{ label: t('products:type.Guide'), value: 'Guide', key: 'Guide' },
|
|
|
|
{ label: t('products:type.Package'), value: 'Package', key: 'Package' },
|
|
|
|
{ label: t('products:type.Attractions'), value: 'Attractions', key: 'Attractions' },
|
|
|
|
{ label: t('products:type.Meals'), value: 'Meals', key: 'Meals' },
|
|
|
|
{ label: t('products:type.Extras'), value: 'Extras', key: 'Extras' },
|
|
|
|
{ label: t('products:type.Special'), value: 'Special', key: 'Special' },
|
|
|
|
];
|
|
|
|
setTypes(newData);
|
|
|
|
}, [i18n.language]);
|
|
|
|
|
|
|
|
return types;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export const useProductsAuditStatus = () => {
|
|
|
|
const [types, setTypes] = useState([]);
|
|
|
|
const { t, i18n } = useTranslation();
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
const newData = [
|
|
|
|
{ value: '0', label: 'New' },
|
|
|
|
{ value: '1', label: 'Pending' },
|
|
|
|
{ value: '2', label: 'Approve' },
|
|
|
|
{ value: '3', label: 'Rejected' },
|
|
|
|
{ value: '4', label: 'Published' },
|
|
|
|
];
|
|
|
|
setTypes(newData);
|
|
|
|
}, [i18n.language]);
|
|
|
|
|
|
|
|
return types;
|
|
|
|
};
|