Change component to use props.children

This commit is contained in:
dora 2021-05-07 23:35:50 -04:00
parent 36ccadcf62
commit 18a4034bcd
1 changed files with 5 additions and 6 deletions

View File

@ -1,14 +1,15 @@
import React from "react";
import { prependOnceListener } from "node:process";
import React, { Children, ReactElement } from "react";
import styles from './newscard.module.css'
interface NewsCardProps {
date: Date;
author: string;
content: string;
children: ReactElement;
}
const NewsCard: React.FC<NewsCardProps> = ({date,author,content}) => {
const NewsCard: React.FC<NewsCardProps> = ({date,author,children}) => {
const options = {year:'numeric', month:'long',day:'numeric'};
return(
@ -23,9 +24,7 @@ const NewsCard: React.FC<NewsCardProps> = ({date,author,content}) => {
{author}
</div>
<div className={styles.content}>
<p>
{content}
</p>
{children}
</div>
</div>
)