Visitenbuch/src/lib/components/table/PatientField.svelte

27 lines
624 B
Svelte

<script lang="ts">
import type { RouterOutput } from "$lib/shared/trpc";
import { gotoEntityQuery } from "$lib/shared/util";
export let patient: RouterOutput["patient"]["list"]["items"][0];
export let baseUrl: string;
function onClick(e: MouseEvent): void {
gotoEntityQuery(
{
filter: {
patient: [
{ id: patient.id, name: `${patient.last_name}, ${patient.first_name}` },
],
},
},
baseUrl,
);
e.stopPropagation();
}
</script>
<button
class="ellipsis"
on:click={onClick}
>{`${patient.first_name} ${patient.last_name}`}</button
>