mirror of
https://github.com/lucasrcsantana/story-generator.git
synced 2025-12-17 05:47:52 +00:00
fix: corrige tipagem do RecordingHistoryCard
- Exporta interface StoryRecording do arquivo de tipos - Adiciona importação da interface no componente - Adiciona tipos explícitos nos parâmetros das funções map - Resolve erros de tipagem no build
This commit is contained in:
parent
1132f7438d
commit
6531a9282c
62
package-lock.json
generated
62
package-lock.json
generated
@ -8,6 +8,7 @@
|
||||
"name": "vite-react-typescript-starter",
|
||||
"version": "0.0.0",
|
||||
"dependencies": {
|
||||
"@radix-ui/react-accordion": "^1.2.2",
|
||||
"@radix-ui/react-tabs": "^1.1.2",
|
||||
"@supabase/supabase-js": "^2.39.7",
|
||||
"clsx": "^2.1.1",
|
||||
@ -1025,6 +1026,67 @@
|
||||
"integrity": "sha512-SJ31y+Q/zAyShtXJc8x83i9TYdbAfHZ++tUZnvjJJqFjzsdUnKsxPL6IEtBlxKkU7yzer//GQtZSV4GbldL3YA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@radix-ui/react-accordion": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-accordion/-/react-accordion-1.2.2.tgz",
|
||||
"integrity": "sha512-b1oh54x4DMCdGsB4/7ahiSrViXxaBwRPotiZNnYXjLha9vfuURSAZErki6qjDoSIV0eXx5v57XnTGVtGwnfp2g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@radix-ui/primitive": "1.1.1",
|
||||
"@radix-ui/react-collapsible": "1.1.2",
|
||||
"@radix-ui/react-collection": "1.1.1",
|
||||
"@radix-ui/react-compose-refs": "1.1.1",
|
||||
"@radix-ui/react-context": "1.1.1",
|
||||
"@radix-ui/react-direction": "1.1.0",
|
||||
"@radix-ui/react-id": "1.1.0",
|
||||
"@radix-ui/react-primitive": "2.0.1",
|
||||
"@radix-ui/react-use-controllable-state": "1.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "*",
|
||||
"@types/react-dom": "*",
|
||||
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
|
||||
"react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/react": {
|
||||
"optional": true
|
||||
},
|
||||
"@types/react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@radix-ui/react-collapsible": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-collapsible/-/react-collapsible-1.1.2.tgz",
|
||||
"integrity": "sha512-PliMB63vxz7vggcyq0IxNYk8vGDrLXVWw4+W4B8YnwI1s18x7YZYqlG9PLX7XxAJUi0g2DxP4XKJMFHh/iVh9A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@radix-ui/primitive": "1.1.1",
|
||||
"@radix-ui/react-compose-refs": "1.1.1",
|
||||
"@radix-ui/react-context": "1.1.1",
|
||||
"@radix-ui/react-id": "1.1.0",
|
||||
"@radix-ui/react-presence": "1.1.2",
|
||||
"@radix-ui/react-primitive": "2.0.1",
|
||||
"@radix-ui/react-use-controllable-state": "1.1.0",
|
||||
"@radix-ui/react-use-layout-effect": "1.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "*",
|
||||
"@types/react-dom": "*",
|
||||
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
|
||||
"react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/react": {
|
||||
"optional": true
|
||||
},
|
||||
"@types/react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@radix-ui/react-collection": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-collection/-/react-collection-1.1.1.tgz",
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
"format": "prettier --write \"src/**/*.{ts,tsx}\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@radix-ui/react-accordion": "^1.2.2",
|
||||
"@radix-ui/react-tabs": "^1.1.2",
|
||||
"@supabase/supabase-js": "^2.39.7",
|
||||
"clsx": "^2.1.1",
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '../ui/accordion';
|
||||
import type { StoryRecording } from '../../types/database';
|
||||
|
||||
export function RecordingHistoryCard({ recording }: { recording: StoryRecording }) {
|
||||
const metrics = [
|
||||
@ -74,7 +75,7 @@ export function RecordingHistoryCard({ recording }: { recording: StoryRecording
|
||||
Pontos Fortes
|
||||
</h5>
|
||||
<ul className="list-disc list-inside text-sm text-gray-600 space-y-1">
|
||||
{recording.strengths.map((strength, i) => (
|
||||
{recording.strengths.map((strength: string, i: number) => (
|
||||
<li key={i} className="leading-relaxed">{strength}</li>
|
||||
))}
|
||||
</ul>
|
||||
@ -86,7 +87,7 @@ export function RecordingHistoryCard({ recording }: { recording: StoryRecording
|
||||
Pontos para Melhorar
|
||||
</h5>
|
||||
<ul className="list-disc list-inside text-sm text-gray-600 space-y-1">
|
||||
{recording.improvements.map((improvement, i) => (
|
||||
{recording.improvements.map((improvement: string, i: number) => (
|
||||
<li key={i} className="leading-relaxed">{improvement}</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
@ -4,7 +4,7 @@ import React from "react";
|
||||
export function DashboardPage(): JSX.Element {
|
||||
return (
|
||||
<DashboardLayout>
|
||||
{/* Conteúdo da página */}
|
||||
<div>Conteúdo do Dashboard</div>
|
||||
</DashboardLayout>
|
||||
);
|
||||
}
|
||||
@ -13,7 +13,7 @@ export async function processAudio(audioFile: File): Promise<ProcessAudioRespons
|
||||
.from('audio-uploads')
|
||||
.upload(fileName, audioFile);
|
||||
|
||||
if (uploadError) throw new uploadError;
|
||||
if (uploadError) throw uploadError;
|
||||
|
||||
// 2. Chama a Edge Function para processar o áudio
|
||||
const { data, error } = await supabase.functions.invoke<ProcessAudioResponse>('process-audio', {
|
||||
|
||||
@ -131,10 +131,19 @@ export interface ClassWithStudentsAndStories extends Class {
|
||||
students: StudentWithStories[];
|
||||
}
|
||||
|
||||
interface StoryRecording {
|
||||
export interface StoryRecording {
|
||||
id: string;
|
||||
student_id: string;
|
||||
story_id: string;
|
||||
audio_url: string;
|
||||
fluency_score: number;
|
||||
pronunciation_score: number;
|
||||
accuracy_score: number;
|
||||
comprehension_score: number;
|
||||
words_per_minute: number;
|
||||
pause_count: number;
|
||||
error_count: number;
|
||||
self_corrections: number;
|
||||
strengths: string[];
|
||||
improvements: string[];
|
||||
suggestions: string;
|
||||
created_at: string;
|
||||
processed_at: string | null;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user