Fix TypeScript build errors
- HelpPage: remove unused navigate import - AdminClientsPage: align state type with API response (hasCustomTemplate vs hasCustom) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
8f57c657fa
commit
b670505956
2 changed files with 3 additions and 5 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import { useState } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { useAuthStore } from '../stores/useAuthStore'
|
||||
|
||||
// ── Section types ──────────────────────────────────────────────────────────────
|
||||
|
|
@ -365,7 +364,6 @@ const SECTIONS: Section[] = [
|
|||
// ── Page ───────────────────────────────────────────────────────────────────────
|
||||
|
||||
export default function HelpPage() {
|
||||
const navigate = useNavigate()
|
||||
const user = useAuthStore(s => s.user)
|
||||
const isAdmin = user?.role === 'admin'
|
||||
const [activeId, setActiveId] = useState('overview')
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ export default function AdminClientsPage() {
|
|||
// ── Export template per-client ─────────────────────────────────────────────────
|
||||
|
||||
function ClientExportTemplate({ clientId }: { clientId: string }) {
|
||||
const [data, setData] = useState<{ template: ExportTemplateColumn[]; hasCustom: boolean; fields: string[] } | null>(null)
|
||||
const [data, setData] = useState<{ template: ExportTemplateColumn[]; hasCustomTemplate: boolean; fields: string[] } | null>(null)
|
||||
|
||||
useEffect(() => {
|
||||
getClientExportTemplate(clientId).then(setData).catch(() => {})
|
||||
|
|
@ -198,8 +198,8 @@ function ClientExportTemplate({ clientId }: { clientId: string }) {
|
|||
Export CSV template
|
||||
</div>
|
||||
<ExportTemplateEditor
|
||||
template={data.hasCustom ? data.template : null}
|
||||
hasCustom={data.hasCustom}
|
||||
template={data.hasCustomTemplate ? data.template : null}
|
||||
hasCustom={data.hasCustomTemplate}
|
||||
internalFields={data.fields}
|
||||
onDetect={file => detectClientExportTemplate(clientId, file)}
|
||||
onSave={async tpl => { await saveClientExportTemplate(clientId, tpl); await reload() }}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue