post comments fix

This commit is contained in:
2025-03-11 15:20:51 +08:00
parent 9d89eb4290
commit b53fe1b6b0
4 changed files with 719 additions and 226 deletions

View File

@@ -595,26 +595,21 @@ const Analytics: React.FC = () => {
// 项目选择器组件
const ProjectSelector = () => (
<div className="mb-6">
<label htmlFor="project-select" className="block text-sm font-medium text-gray-700 mb-2">
</label>
<div className="relative">
<select
id="project-select"
value={selectedProject}
onChange={(e) => setSelectedProject(e.target.value)}
className="block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md"
>
{projects.map((project) => (
<option key={project.id} value={project.id}>
{project.name}
</option>
))}
</select>
<div className="absolute inset-y-0 right-0 flex items-center px-2 pointer-events-none">
<ArrowRight className="h-4 w-4 text-gray-400" />
</div>
<div className="relative w-64">
<select
id="project-select"
value={selectedProject}
onChange={(e) => setSelectedProject(e.target.value)}
className="block w-full py-2 pl-3 pr-10 text-base border-gray-300 rounded-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm"
>
{projects.map((project) => (
<option key={project.id} value={project.id}>
{project.name}
</option>
))}
</select>
<div className="absolute inset-y-0 right-0 flex items-center px-2 pointer-events-none">
<ArrowRight className="w-4 h-4 text-gray-400" />
</div>
</div>
);
@@ -624,11 +619,7 @@ const Analytics: React.FC = () => {
<div className="p-6">
<h1 className="mb-6 text-2xl font-bold">Analytics Dashboard</h1>
{/* 添加项目选择器 */}
<ProjectSelector />
{/* Add the Influencer Tracking Form at the top */}
<InfluencerTrackingFormComponent />
{/* 删除这里的项目选择器 */}
{loading ? (
<div className="flex flex-col items-center justify-center h-80">
@@ -653,6 +644,7 @@ const Analytics: React.FC = () => {
<div className="flex flex-col items-start justify-between mb-6 space-y-4 lg:flex-row lg:items-center lg:space-y-0">
<h2 className="text-2xl font-bold text-gray-800"></h2>
<div className="flex flex-col space-y-3 sm:flex-row sm:space-y-0 sm:space-x-4">
<ProjectSelector />
<div className="flex space-x-2">
<select
className="px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"

File diff suppressed because it is too large Load Diff

View File

@@ -294,6 +294,7 @@ const PostList: React.FC<PostListProps> = ({ influencerId, projectId }) => {
// Handle post click to view comments
const handleViewComments = (postId: string) => {
console.log('Navigating to comments for post:', postId);
navigate(`/comments?post_id=${postId}`);
};

View File

@@ -1,6 +1,6 @@
export interface Comment {
id: string;
platform: 'facebook' | 'threads' | 'instagram' | 'linkedin' | 'xiaohongshu' | 'youtube';
platform: 'facebook' | 'threads' | 'instagram' | 'linkedin' | 'xiaohongshu' | 'youtube' | 'twitter';
contentType?: 'post' | 'reel' | 'video' | 'short';
content: string;
author: string;
@@ -59,7 +59,7 @@ export interface ReplyPersona {
export interface ReplyAccount {
id: string;
name: string;
platform: 'facebook' | 'threads' | 'instagram' | 'linkedin' | 'xiaohongshu' | 'youtube';
platform: 'facebook' | 'threads' | 'instagram' | 'linkedin' | 'xiaohongshu' | 'youtube' | 'twitter';
avatar: string;
role: 'admin' | 'moderator' | 'support';
}