import { Box, Button, Card, TextField, Typography } from "@mui/material";
import React, { useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import {addPost} from "./posts.store"
import moment from "moment";
import("./index.scss");
export default function General(){
const posts = useSelector((state) => state.generalposts.posts)
return <>
Assemble
{posts.map(({id,date,context}) => {
return
})}
>
};
function CreateNewPost()
{
const dispatch = useDispatch()
const [text, setText] = useState("");
function clickEvent()
{
dispatch(addPost(text));
setText("");
}
return
setText(event.target.value) }
/>
}
function PostTemplete({id, date, context})
{
return
Abdussamed ULUTAŞ
{context}
{moment(date).locale("tr").fromNow(false)} yayımladı
}