import React, {useContext, useEffect} from "react"; import {Button, Card, Col, Row, Table, Typography} from "antd"; import {BreadcumbComponent} from "../../component/BreadcumbComponent"; import {LINKS} from "../../routes/app"; import {useStore} from "../../utils/useStore"; import {observer} from "mobx-react-lite"; import {FilterOutlined} from "@ant-design/icons"; import {format, parseISO} from "date-fns"; import {ModalLoaderContext} from "../../utils/modal"; const {Title, Text} = Typography; export const Profile = observer(() => { const store = useStore(); const modalLoader = useContext(ModalLoaderContext); const routeData = [ { route: LINKS.HOME, name: "Home", }, { route: LINKS.PROFILE, name: Profile, }, ]; useEffect(() => { (async () => { modalLoader.setLoading(true); await Promise.allSettled([ store.authentication.getProfile(), store.transaction.getDataHistoryTransaction(), ]); modalLoader.setLoading(false); })() }, []); const columns = [ { title: 'Markup Price', dataIndex: 'mark_up_price', key: 'mark_up_price', width: '20%', render: (text) => new Intl.NumberFormat("id-ID", { style: "currency", currency: "IDR", }).format(text), }, { title: 'Name', dataIndex: 'name', key: 'name', width: '50%', }, { title: 'Transaction Date', dataIndex: 'created_at', key: 'created_at', render: (text, record) => { return ( {format(parseISO(record.created_at), 'dd MMMM yyyy HH:mm')} ) }, }, ] const styleSaldoTitle = store.ui.mediaQuery.isDesktop ? { display: "flex", justifyContent: "center" } : {fontSize: "0.75rem"}; const styleSaldoContent = store.ui.mediaQuery.isDesktop ? { fontSize: '1.25rem', display: "flex", justifyContent: "center" } : null; return (
Profile Name {store.authentication.profileData?.userDetail?.name} Phone Number {store.authentication.profileData?.userDetail?.phone_number} Username {store.authentication.profileData?.username} Role {store.authentication.profileData.roles?.name} Superior {store.authentication.profileData.superior?.username} Saldo {store.authentication.profileData?.wallet}
History User Transaction
) });