Files
tabler/shared/components/cards/ProjectProgress.astro
T
codecalm f27c70ad38 Fix Prettier formatting regression and Astro type-check errors
`Render Modal as real markup` (#2742) reformatted ~140 files back to
tabs/semicolons, breaking the Prettier config added by the Astro
quality gates (#2749). Re-run prettier --write to restore it, and fix
the type errors it had been masking: HTMLElement casts and `this`
typing in ChangePasswordModalContent/ConfirmDeleteModalContent
scripts, plain-JS syntax in the inline-injected progress.astro script,
narrowed prop unions in Button/Check/Spinner, nullable icon svg casts
in Icons/Rating, and a duplicate firstLetters/invalid `placeholder`
attribute in Select.astro. Also fix shared/vitest.config.mts's stale
`astro/lib/**/*.test.ts` include glob left over from the shared source
restructure, which made `pnpm test` report zero test files.
2026-08-03 01:26:19 +02:00

52 lines
1.3 KiB
Plaintext

---
// NOTE: `days-ago` param accepted but unused ("Updated 2 hours ago" is hardcoded).
import Progress from '@ui/Progress.astro'
import CardDropdown from '@ui/CardDropdown.astro'
import projects from '@data/projects.json'
interface Project {
title?: string
image?: string
[key: string]: unknown
}
interface Props {
projectId?: number
progress?: number
daysAgo?: number
}
const { projectId = 0, progress = 25 } = Astro.props
const project = (projects as Project[])[projectId]
---
<div class="card">
<div class="card-body">
<div class="row align-items-center">
<div class="col-3">
<img src={project.image} alt={project.title} class="rounded" />
</div>
<div class="col">
<h3 class="card-title mb-1">
<a href="#" class="text-reset">{project.title}</a>
</h3>
<div class="text-secondary">Updated 2 hours ago</div>
<div class="mt-3">
<div class="row g-2 align-items-center">
<div class="col-auto">
{progress}%
</div>
<div class="col">
<Progress value={progress} size="sm" />
</div>
</div>
</div>
</div>
<div class="col-auto">
<CardDropdown />
</div>
</div>
</div>
</div>