mirror of
https://github.com/danbulant/Portfolio
synced 2026-07-07 03:50:36 +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';
|
import type { CandidatePreview } from '$lib/stores/candidate';
|
||||||
|
|
||||||
export let candidates: Array<CandidatePreview> = [];
|
export let candidates: Array<CandidatePreview> = [];
|
||||||
|
export let showCreatedAt: boolean;
|
||||||
|
|
||||||
const formatRustChronoDateTime = (date?: string) => {
|
const formatRustChronoDateTime = (date?: string) => {
|
||||||
if (!date) return '';
|
if (!date) return '';
|
||||||
|
|
@ -24,7 +25,9 @@
|
||||||
<th scope="col"> Obor </th>
|
<th scope="col"> Obor </th>
|
||||||
<th scope="col"> Rodné číslo </th>
|
<th scope="col"> Rodné číslo </th>
|
||||||
<th scope="col"> Link </th>
|
<th scope="col"> Link </th>
|
||||||
<th scope="col"> Vytvořeno </th>
|
{#if showCreatedAt}
|
||||||
|
<th scope="col"> Vytvořeno </th>
|
||||||
|
{/if}
|
||||||
<th scope="col" />
|
<th scope="col" />
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
@ -47,9 +50,11 @@
|
||||||
<td class="text-gray-900">
|
<td class="text-gray-900">
|
||||||
{candidate.relatedApplications?.filter((a) => a !== candidate.applicationId)}
|
{candidate.relatedApplications?.filter((a) => a !== candidate.applicationId)}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-gray-900">
|
{#if showCreatedAt}
|
||||||
{formatRustChronoDateTime(candidate.createdAt)}
|
<td class="text-gray-900">
|
||||||
</td>
|
{formatRustChronoDateTime(candidate.createdAt)}
|
||||||
|
</td>
|
||||||
|
{/if}
|
||||||
<td class="text-sm">
|
<td class="text-sm">
|
||||||
<Delete id={candidate.applicationId} on:delete value="Odstranit" />
|
<Delete id={candidate.applicationId} on:delete value="Odstranit" />
|
||||||
</td>
|
</td>
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,7 @@
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue