js 의존성 제거
This commit is contained in:
@@ -5,9 +5,9 @@ import { useSyncChannelId } from "@/hooks/useSyncChannelId";
|
||||
import { DynamicTable } from "@/components/DynamicTable";
|
||||
import {
|
||||
getFeedbacks,
|
||||
getFeedbackSchema,
|
||||
getFeedbackFields,
|
||||
type Feedback,
|
||||
type FeedbackSchema,
|
||||
type FeedbackField,
|
||||
} from "@/services/feedback";
|
||||
import { ErrorDisplay } from "@/components/ErrorDisplay";
|
||||
import { Button } from "@/components/ui/button";
|
||||
@@ -17,7 +17,7 @@ export function FeedbackListPage() {
|
||||
const { projectId, channelId } = useSettingsStore();
|
||||
const navigate = useNavigate();
|
||||
|
||||
const [schema, setSchema] = useState<FeedbackSchema | null>(null);
|
||||
const [schema, setSchema] = useState<FeedbackField[] | null>(null);
|
||||
const [feedbacks, setFeedbacks] = useState<Feedback[]>([]);
|
||||
const [loading, setLoading] = useState<boolean>(true);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
@@ -30,7 +30,7 @@ export function FeedbackListPage() {
|
||||
setLoading(true);
|
||||
setError(null);
|
||||
|
||||
const schemaData = await getFeedbackSchema(projectId, channelId);
|
||||
const schemaData = await getFeedbackFields(projectId, channelId);
|
||||
setSchema(schemaData);
|
||||
|
||||
const feedbacksData = await getFeedbacks(projectId, channelId);
|
||||
@@ -67,11 +67,13 @@ export function FeedbackListPage() {
|
||||
</div>
|
||||
{error && <ErrorDisplay message={error} />}
|
||||
{schema && (
|
||||
<DynamicTable
|
||||
schema={schema}
|
||||
data={feedbacks}
|
||||
onRowClick={handleRowClick}
|
||||
/>
|
||||
<div className="mt-6">
|
||||
<DynamicTable
|
||||
columns={schema}
|
||||
data={feedbacks}
|
||||
onRowClick={handleRowClick}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user