From d78ad28607a2662a9ebabb332eb9353b790384dd Mon Sep 17 00:00:00 2001 From: Khafid Prayoga Date: Thu, 11 Dec 2025 15:49:56 +0700 Subject: [PATCH] adjust detail preview feat(patient): add disability field and centralize disability codes Move disability options to constants file and implement in both select component and patient preview feat(patient-preview): add document section with skeleton loading Add a new "Dokumen" section to the patient preview component that displays skeleton placeholders for KTP and KK documents. This improves the UI by showing loading states for document previews. --- .../app/patient/fields/select-disability.vue | 17 ++- app/components/app/patient/preview.vue | 33 +++++- app/lib/constants.ts | 104 +++++++++++------- 3 files changed, 102 insertions(+), 52 deletions(-) diff --git a/app/components/app/patient/fields/select-disability.vue b/app/components/app/patient/fields/select-disability.vue index 6058773a..46f6231d 100644 --- a/app/components/app/patient/fields/select-disability.vue +++ b/app/components/app/patient/fields/select-disability.vue @@ -5,6 +5,9 @@ import { cn } from '~/lib/utils' import * as DE from '~/components/pub/my-ui/doc-entry' +import { disabilityCodes } from '~/lib/constants' +import { mapToComboboxOptList } from '~/lib/utils' + const props = defineProps<{ fieldName?: string label?: string @@ -26,16 +29,10 @@ const { fieldGroupClass, } = props -const disabilityOptions = [ - { label: 'Tuna Daksa', value: 'daksa' }, - { label: 'Tuna Netra', value: 'netra' }, - { label: 'Tuna Rungu', value: 'rungu' }, - { label: 'Tuna Wicara', value: 'wicara' }, - { label: 'Tuna Rungu-Wicara', value: 'rungu_wicara' }, - { label: 'Tuna Grahita', value: 'grahita' }, - { label: 'Tuna Laras', value: 'laras' }, - { label: 'Lainnya', value: 'other', priority: -100 }, -] +const disabilityOptions = mapToComboboxOptList(disabilityCodes).map(({ label, value }) => ({ + label, + value, +}))