Untitled

mail@pastecode.io avatar
unknown
javascript
2 years ago
4.6 kB
1
Indexable
Never
{render == 1 && (
                                        <div>
                                            {/* <tbody> */}
                                            <div className={styles.searchContainer}>
                                                <button id={styles.iconAdd} onClick={handleAddArticle}>
                                                    Thêm
                                                </button>
                                                <input
                                                    type="text"
                                                    className={styles.searchBar}
                                                    autoComplete="none"
                                                    onChange={handleOnChangePostSearch}
                                                ></input>
                                            </div>
                                            <section
                                                id="alskdj"
                                                className={styles.tableContent}
                                                style={{ marginTop: '-7px' }}
                                            >
                                                <tr>
                                                    <th className={styles.th1} width="10%">
                                                        <strong>Id</strong>
                                                    </th>
                                                    <th className={styles.th1} width="50%">
                                                        <strong>Tiêu đề</strong>
                                                    </th>
                                                    <th className={styles.th1} width="20%">
                                                        <strong>Ngày đăng</strong>
                                                    </th>
                                                    <th className={styles.th1} width="20%">
                                                        <strong>Ngày cập nhật</strong>
                                                    </th>
                                                    <th className={styles.th1}>
                                                        <strong>Xóa</strong>
                                                    </th>
                                                    <th className={styles.th1}>
                                                        <strong>Sửa</strong>
                                                    </th>
                                                </tr>

                                                {currentPosts?.map((item) => (
                                                    <tr key={item.id}>
                                                        <th width="10%">{item.id}</th>
                                                        <th width="50%">{truncateString(item.title)}</th>
                                                        <th width="20%">{item.datePost}</th>
                                                        <th width="20%">{item.dateUpdate}</th>
                                                        <th
                                                            style={{ cursor: 'pointer' }}
                                                            onClick={() => handleDeletePost(item.id)}
                                                        >
                                                            <i class="trashcan fa-solid fa-trash"></i>
                                                        </th>
                                                        <th
                                                            style={{ cursor: 'pointer', color: 'blue' }}
                                                            onClick={() => handleEditPost(item.id)}
                                                        >
                                                            <i class="fa-solid fa-pen-to-square"></i>
                                                        </th>
                                                    </tr>
                                                ))}
                                            </section>
                                            {/* </tbody> */}
                                        </div>
                                    )}