diff --git a/src/ts/components/Cards/components/LineWithTemplate.tsx b/src/ts/components/Cards/components/LineWithTemplate.tsx new file mode 100644 index 0000000..f4c7e8a --- /dev/null +++ b/src/ts/components/Cards/components/LineWithTemplate.tsx @@ -0,0 +1,42 @@ +import React from 'react'; +import { useTranslation } from 'react-i18next'; + +import { IColumn } from 'ts/components/Table/interfaces/Column'; + +import style from '../styles/index.module.scss'; + +interface LineWithTemplateProps { + column: IColumn; + item: any; + className?: string | Function; + value: React.ReactNode | React.ReactNode[] | null; +} + +function LineWithTemplate({ + column, + item, + className, + value, +}: LineWithTemplateProps): JSX.Element | null { + const { t } = useTranslation(); + const columnClassName = typeof column.className === 'function' + ? column.className('body', item) + : column.className; + + if (!value) return null; + + return ( +