mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-19 06:21:15 +00:00
feat: show createdAt only when chrono application table view
This commit is contained in:
parent
6d1b3a86c0
commit
c905effd92
2 changed files with 10 additions and 5 deletions
|
|
@ -3,6 +3,7 @@
|
|||
import type { CandidatePreview } from '$lib/stores/candidate';
|
||||
|
||||
export let candidates: Array<CandidatePreview> = [];
|
||||
export let showCreatedAt: boolean;
|
||||
|
||||
const formatRustChronoDateTime = (date?: string) => {
|
||||
if (!date) return '';
|
||||
|
|
@ -24,7 +25,9 @@
|
|||
<th scope="col"> Obor </th>
|
||||
<th scope="col"> Rodné číslo </th>
|
||||
<th scope="col"> Link </th>
|
||||
<th scope="col"> Vytvořeno </th>
|
||||
{#if showCreatedAt}
|
||||
<th scope="col"> Vytvořeno </th>
|
||||
{/if}
|
||||
<th scope="col" />
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -47,9 +50,11 @@
|
|||
<td class="text-gray-900">
|
||||
{candidate.relatedApplications?.filter((a) => a !== candidate.applicationId)}
|
||||
</td>
|
||||
<td class="text-gray-900">
|
||||
{formatRustChronoDateTime(candidate.createdAt)}
|
||||
</td>
|
||||
{#if showCreatedAt}
|
||||
<td class="text-gray-900">
|
||||
{formatRustChronoDateTime(candidate.createdAt)}
|
||||
</td>
|
||||
{/if}
|
||||
<td class="text-sm">
|
||||
<Delete id={candidate.applicationId} on:delete value="Odstranit" />
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@
|
|||
</div>
|
||||
{/if}
|
||||
|
||||
<Table candidates={candidatesTable} on:delete={(event) => deleteCandidate(event.detail.id)} />
|
||||
<Table showCreatedAt={activeFilter.class === 'Chronologicky'} candidates={candidatesTable} on:delete={(event) => deleteCandidate(event.detail.id)} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue