| import React from 'react';
|
| import { useNavigate,useLocation } from 'react-router-dom';
|
| import './personalSubpage.css';
|
| const Upload = ({ onLogout }) => {
|
| const navigate = useNavigate();
|
| const location = useLocation();
|
| const [uploads] = React.useState([
|
| { id: 1, name: '星际穿越', status: '已发布', date: '2023-10-15', size: '15.2GB' },
|
| { id: 2, name: '黑暗骑士', status: '审核中', date: '2023-10-18', size: '12.7GB' }
|
| const handleBack = () => {
|
| fromSubpage: true, // 标记来自子页面
|
| dashboardTab: location.state?.dashboardTab // 保留Dashboard的标签页状态
|
| replace: true // 替换当前历史记录
|
| <div className="subpage-container">
|
| <button className="back-button" onClick={(handleBack)}>
|
| <h2 className="page-title">上传记录</h2>
|
| <table className="uploads-table">
|
| <tr key={item.id} className="list-item">
|
| <span className={`status-badge ${
|
| item.status === '已发布' ? 'published' : 'pending'
|
| <button className="action-btn">详情</button>
|