// #region [Imports] ===================================================================================================
// Libraries
import { Table } from "antd";
// Components
import WidgetLinkIcon from "./WidgetLinkIcon";
import Tooltip from "./Tooltip";
// Types
import { IDashboardWidget, ICouponWidgetTableData } from "../../../types/dashboard";
// Helpers
import { sanitizeHtml } from "../../../../shared/utils";
// #endregion [Imports]
// #region [Variables] =================================================================================================
declare var acfwAdminApp: any;
// #endregion [Variables]
// #region [Interfaces]=================================================================================================
interface IProps {
widget: IDashboardWidget;
}
// #endregion [Interfaces]
// #region [Component] =================================================================================================
const CouponTableWidget = (props: IProps) => {
const {widget} = props;
const {dashboard_page: {labels, coupons_list_link}, admin_url} = acfwAdminApp;
const columns = [
{
title: labels.coupon,
dataIndex: 'coupon',
key: 'coupon',
render: (text: string, record: ICouponWidgetTableData) => (
{text}
)
},
{
title: labels.uses,
dataIndex: 'usage_total',
key: 'usage_total',
},
{
title: (
<>
{labels.discounted}
{widget?.tooltip_html ?