summaryrefslogtreecommitdiff
path: root/src/components/transactions/TransactionDetail.js
blob: 6d304d3131fd3785d204259141279dbc2ed58046 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import DescriptionRow from "../elements/DescriptionRow";

const CustomerSection = ({ address }) => {
  const fullAddress = [];
  if (address?.street) fullAddress.push(address.street);
  if (address?.sub_district?.name) fullAddress.push(address.sub_district.name);
  if (address?.district?.name) fullAddress.push(address.district.name);
  if (address?.city?.name) fullAddress.push(address.city.name);
  return (
    <div className="px-4 pb-4 flex flex-col gap-y-4">
      <DescriptionRow label="Nama">{ address?.name }</DescriptionRow>
      <DescriptionRow label="Email">{ address?.email || '-' }</DescriptionRow>
      <DescriptionRow label="No Telepon">{ address?.mobile || '-' }</DescriptionRow>
      <DescriptionRow label="Alamat">{ fullAddress.join(', ') }</DescriptionRow>
    </div>
  );
};

export {
  CustomerSection
};