import { Box, Tooltip, Button } from '@material-ui/core'; import { makeStyles, Theme } from '@material-ui/core/styles'; import React from 'react'; import { MarketplaceListing } from '../../../../../../typings/marketplace'; import { useSimcard } from '../../../../os/simcard/hooks/useSimcard'; import DeleteIcon from '@material-ui/icons/Delete'; import ReportIcon from '@material-ui/icons/Report'; import ChatIcon from '@material-ui/icons/Chat'; import PhoneIcon from '@material-ui/icons/Phone'; import Nui from '../../../../os/nui-events/utils/Nui'; import { useTranslation } from 'react-i18next'; import { useHistory } from 'react-router'; const useStyles = makeStyles((theme: Theme) => ({ icon: { color: theme.palette.primary.main, }, })); export const ListingActions = ({ listing }: { listing: MarketplaceListing }) => { const classes = useStyles(); const { number: myNumber } = useSimcard(); const { t } = useTranslation(); const history = useHistory(); const handleDeleteListing = () => { Nui.send('phone:marketplaceDeleteListing', { id: listing.id, }); }; const handleReportListing = () => { Nui.send('phone:reportListing', listing); }; const handleCall = () => { Nui.send('phone:beginCall', { number: listing.number, }); }; const handleMessage = () => { history.push(`/messages/new/${listing.number}`); }; return (
{listing.number !== myNumber ? ( <> ) : null}
{listing.number === myNumber ? ( ) : ( )}
); };