Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | import { Typography } from "@mui/material"; import { useTranslation } from "i18n"; import { MESSAGES } from "i18n/namespaces"; import { HostRequestStatus } from "proto/conversations_pb"; interface HostRequestStatusTextProps { isHost: boolean; requestStatus: HostRequestStatus; } export default function HostRequestStatusText({ isHost, requestStatus, }: HostRequestStatusTextProps) { const { t } = useTranslation(MESSAGES); let statusText = ""; Iif (requestStatus === HostRequestStatus.HOST_REQUEST_STATUS_PENDING) { statusText = t("host_request_item.pending"); } if (isHost) { switch (requestStatus) { case HostRequestStatus.HOST_REQUEST_STATUS_ACCEPTED: statusText = t("host_request_item.host_status.accepted"); break; case HostRequestStatus.HOST_REQUEST_STATUS_CANCELLED: statusText = t("host_request_item.host_status.cancelled"); break; case HostRequestStatus.HOST_REQUEST_STATUS_CONFIRMED: statusText = t("host_request_item.host_status.confirmed"); break; case HostRequestStatus.HOST_REQUEST_STATUS_REJECTED: statusText = t("host_request_item.host_status.rejected"); break; } } else { switch (requestStatus) { case HostRequestStatus.HOST_REQUEST_STATUS_ACCEPTED: statusText = t("host_request_item.surfer_status.accepted"); break; case HostRequestStatus.HOST_REQUEST_STATUS_CANCELLED: statusText = t("host_request_item.surfer_status.cancelled"); break; case HostRequestStatus.HOST_REQUEST_STATUS_CONFIRMED: statusText = t("host_request_item.surfer_status.confirmed"); break; case HostRequestStatus.HOST_REQUEST_STATUS_REJECTED: statusText = t("host_request_item.surfer_status.rejected"); break; } } return <Typography variant="body2">{statusText}</Typography>; } |