import {FC} from "react";
import {DealSummary} from "../../../client";
import styles from './DealSummaryCard.module.css';

import {Text} from '@mantine/core';
import classNames from "classnames";

type Props = {
    dealSummary: DealSummary
}

const DealSummaryCard: FC<Props> = ({dealSummary}) => {
    return (
        <div className={styles['container']}>
            <div className={styles['flex-row']}>
                <div className={styles['flex-item']}>
                    <Text size={"sm"} c={"gray.6"}>
                        {dealSummary.client_name}
                    </Text>
                </div>
                <div className={styles['flex-item']}>
                    <Text size={"md"} c={"blue.5"}>{dealSummary.name}</Text>
                </div>
                <div className={styles['flex-item']}>
                    <Text size={"sm"} c={"gray.6"}>
                        {dealSummary.total_price.toLocaleString('ru-RU')} руб
                    </Text>
                </div>
            </div>
            <div className={classNames(styles['flex-row'], styles['flex-row-right'])}>
                <div className={styles['flex-item']}>
                    <Text size={"sm"} c={"gray.6"}>
                        {new Date(dealSummary.changed_at).toLocaleString('ru-RU')}
                    </Text>
                </div>
                <div className={styles['flex-item']}>
                    <Text size={"sm"} c={"yellow.8"}>
                        Нет задач
                    </Text>
                </div>
            </div>

        </div>
    )
}
export default DealSummaryCard;
