Skip to content

Commit

Permalink
add inteface IProps
Browse files Browse the repository at this point in the history
  • Loading branch information
dzonidoo committed Dec 8, 2023
1 parent e6c0c7a commit 851315c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions assets/interfaces/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export interface IArticle extends IResourceItem {
type?: 'transcript';
[key: string]: any;
};
expiry?: string;
es_highlight?: {[field: string]: Array<string>}
deleted?: boolean; // Used only in the front-end, populated by wire/reducer
}
18 changes: 11 additions & 7 deletions assets/wire/components/fields/ExpiryDateLabel.tsx
Original file line number Diff line number Diff line change
@@ -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;
}
Expand All @@ -15,8 +24,3 @@ export function ExpiryDateLabel ({item, filterGroupLabels}: any) {
<span>{text}</span>
);
}

ExpiryDateLabel.propTypes = {
item: PropTypes.object,
filterGroupLabels: PropTypes.object,
};

0 comments on commit 851315c

Please sign in to comment.