Change component to use props.children
This commit is contained in:
parent
36ccadcf62
commit
18a4034bcd
|
@ -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>
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue