From 851315c887ea665018b2bee4310ad22751364334 Mon Sep 17 00:00:00 2001 From: dzonidoo Date: Fri, 8 Dec 2023 15:12:14 +0100 Subject: [PATCH] add inteface IProps --- assets/interfaces/content.ts | 1 + .../wire/components/fields/ExpiryDateLabel.tsx | 18 +++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/assets/interfaces/content.ts b/assets/interfaces/content.ts index 375568ae7..21feba4b8 100644 --- a/assets/interfaces/content.ts +++ b/assets/interfaces/content.ts @@ -27,6 +27,7 @@ export interface IArticle extends IResourceItem { type?: 'transcript'; [key: string]: any; }; + expiry?: string; es_highlight?: {[field: string]: Array} deleted?: boolean; // Used only in the front-end, populated by wire/reducer } diff --git a/assets/wire/components/fields/ExpiryDateLabel.tsx b/assets/wire/components/fields/ExpiryDateLabel.tsx index dac139217..7cf92caab 100644 --- a/assets/wire/components/fields/ExpiryDateLabel.tsx +++ b/assets/wire/components/fields/ExpiryDateLabel.tsx @@ -1,8 +1,17 @@ import React from 'react'; -import PropTypes from 'prop-types'; import {gettext, formatDate} from 'utils'; +import {IArticle} from 'interfaces'; + +interface IProps { + item: IArticle, + filterGroupLabels: { + [field: string]: string; + }, +} + +export function ExpiryDateLabel (props: IProps) { + const {item, filterGroupLabels} = props; -export function ExpiryDateLabel ({item, filterGroupLabels}: any) { if (item.expiry == null) { return null; } @@ -15,8 +24,3 @@ export function ExpiryDateLabel ({item, filterGroupLabels}: any) { {text} ); } - -ExpiryDateLabel.propTypes = { - item: PropTypes.object, - filterGroupLabels: PropTypes.object, -};