CFE-17 fixed porblem of call history showing

This commit is contained in:
2023-11-19 14:23:06 +03:30
parent 0d88145c74
commit da7b7852b0
4 changed files with 13 additions and 9 deletions

View File

@@ -261,7 +261,8 @@
"call_history_of": "تاریخچه تماس های",
"call_history_not_found": "تاریخچه ای برای تماس دریافتی یافت نشد",
"call_history_error_fetching": "خطا در دریافت تاریخچه تماس دریافتی",
"show_more": "نمایش موارد بیشتر"
"show_more": "نمایش موارد بیشتر",
"no_data_exist": "اطلاعاتی موجود نیست"
},
"CallAction": {
"call_history_of": "عملیات های مربوط به تماس",

View File

@@ -1,8 +1,11 @@
import {useTranslations} from "next-intl";
import {Avatar, Box, ListItem, ListItemAvatar, ListItemText, Typography} from "@mui/material";
import HeadsetMicIcon from '@mui/icons-material/HeadsetMic';
import useLanguage from "@/lib/app/hooks/useLanguage";
import moment from "jalali-moment";
const PreviousOperatorData = ({historyItem}) => {
const {languageApp} = useLanguage()
const t = useTranslations();
return (
<ListItem>
@@ -14,13 +17,13 @@ const PreviousOperatorData = ({historyItem}) => {
<ListItemText primary={
<Box sx={{display: "flex", alignItems: "end"}}>
<Typography sx={{marginRight: 1, color: "#545151"}}>
{historyItem.operator_name}
{historyItem.operator_full_name}
</Typography>
<Typography variant="caption" sx={{color: "secondary.main"}}>
({t("CallHistory.operator")})
</Typography>
</Box>
} secondary={historyItem.answer_date}/>
} secondary={moment(historyItem.created_at).locale(languageApp).format("HH:mm:ss | YYYY/MM/DD")}/>
</ListItem>
)
}

View File

@@ -12,7 +12,7 @@ const Topics = ({historyItem}) => {
{t("CallHistory.category_name")}:
</Typography>
<Typography variant="subtitle2" sx={{color: "#837e7e"}}>
{historyItem.category_name}
{historyItem.category_name || t("CallHistory.no_data_exist")}
</Typography>
</Box>
</ListItem>
@@ -31,7 +31,7 @@ const Topics = ({historyItem}) => {
textAlign: "end",
color: "#837e7e"
}}>
{historyItem.subcategory_name}
{historyItem.subcategory_name || t("CallHistory.no_data_exist")}
</Typography>
</Box>
</ListItem>

View File

@@ -6,7 +6,7 @@ import HistoryHeader from "./HistoryHeader";
import ErrorOrEmpty from "./ErrorOrEmpty";
import useCallerHistory from "@/lib/callWidget/hooks/useCallerHistory";
import ListItemOfCalls from "./ListItemOfCalls";
import {useState} from "react";
import {Fragment, useState} from "react";
const max_size = 10;
const CallHistory = ({tab}) => {
@@ -40,7 +40,7 @@ const CallHistory = ({tab}) => {
<Chip
icon={<HeadphonesIcon/>}
onClick={() => setShowRestOfHistory(true)}
label={t("show_more")}
label={t("CallHistory.show_more")}
disabled={showRestOfHistory}
/>
</Divider>
@@ -48,10 +48,10 @@ const CallHistory = ({tab}) => {
{showRestOfHistory && (
<>
{historyList.map((historyItem, index) => (
<>
<Fragment key={historyItem.id}>
<ListItemOfCalls key={historyItem.id} historyItem={historyItem}/>
<Divider/>
</>
</Fragment>
))}
</>)
}