diff --git a/src/kit/form-field.tsx b/src/kit/form-field.tsx index 297cd4b..6cd759a 100644 --- a/src/kit/form-field.tsx +++ b/src/kit/form-field.tsx @@ -1,5 +1,6 @@ import * as React from "react" +import { cn } from "@/lib/utils" import { Label } from "@/components/ui/label" /** Подзаголовок группы полей формы. */ @@ -18,16 +19,18 @@ export function FormField({ htmlFor, hint, error, + className, children, }: { label: string htmlFor?: string hint?: string error?: string + className?: string children: React.ReactNode }) { return ( -
| Услуга | + {!compact &&Кол-во | } + {!compact &&Стоимость | } +Сумма | + {onStatusChange &&Статус услуги | } + {editable && onRemove &&} + |
|---|---|---|---|---|---|
|
+
+ {line.code} {line.name}
+
+
+ {line.category}
+
+ {compact && line.price > 0 && (
+
+ {line.quantity} × {formatMoney(line.price)}
+
+ )}
+ |
+ {!compact && (
+
+ {editable && onQuantityChange ? (
+
+
+ {line.quantity}
+
+
+ ) : (
+ {line.quantity}
+ )}
+ |
+ )}
+ {!compact && {line.price ? formatMoney(line.price) : "—"} | } +
+ {line.price ? formatMoney(line.price * line.quantity) : "ОМС"}
+ {showStatus && line.price > 0 && (
+ |
+ {onStatusChange && (
+ + {/* Бесплатную услугу (ОМС) оплачивать не нужно — статуса нет */} + {line.price === 0 ? ( + — + ) : ( + + )} + | + )} + {editable && onRemove && ( ++ + | + )} +