@@ -3,6 +3,7 @@ import { Link, Outlet, useParams } from "react-router";
33import {
44 getAuditManifest ,
55 getDependencyManifest ,
6+ runExtraction ,
67} from "../../service/api/index.ts" ;
78import type {
89 AuditManifest ,
@@ -102,15 +103,36 @@ export default function BaseAuditPage() {
102103 [ ] ,
103104 ) ;
104105
105- function extractSymbols ( ) {
106+ async function extractSymbols ( ) {
106107 setBusy ( true ) ;
107- // TODO: Implement
108- setBusy ( false ) ;
108+ const extractionToast = toast ( {
109+ title : "Extracting symbols" ,
110+ description : "This may take a while..." ,
111+ } ) ;
112+ try {
113+ await runExtraction ( symbolsToExtract ) ;
114+ extractionToast . update ( {
115+ id : extractionToast . id ,
116+ description : "Symbols extracted successfully" ,
117+ } ) ;
118+ } catch ( _error ) {
119+ extractionToast . update ( {
120+ id : extractionToast . id ,
121+ description : "Failed to extract symbols" ,
122+ variant : "destructive" ,
123+ } ) ;
124+ } finally {
125+ setBusy ( false ) ;
126+ }
109127 }
110128
111129 useEffect ( ( ) => {
112130 async function handleOnLoad ( ) {
113131 setBusy ( true ) ;
132+ const allPromiseToast = toast ( {
133+ title : "Loading manifests" ,
134+ description : "This may take a while..." ,
135+ } ) ;
114136 try {
115137 const dependencyManifestPromise = getDependencyManifest ( ) ;
116138 const auditManifestPromise = getAuditManifest ( ) ;
@@ -125,13 +147,14 @@ export default function BaseAuditPage() {
125147 setDependencyManifest ( dependencyManifest ) ;
126148 setAuditManifest ( auditManifest ) ;
127149
128- toast ( {
129- title : "Successfully loaded project overview" ,
150+ allPromiseToast . update ( {
151+ id : allPromiseToast . id ,
152+ description : "Manifests loaded successfully" ,
130153 } ) ;
131- } catch ( error ) {
132- toast ( {
133- title : "Failed to load project overview" ,
134- description : error instanceof Error ? error . message : "Unknown error ",
154+ } catch ( _error ) {
155+ allPromiseToast . update ( {
156+ id : allPromiseToast . id ,
157+ description : "Failed to load manifests ",
135158 variant : "destructive" ,
136159 } ) ;
137160 } finally {
0 commit comments