This repository has been archived on 2026-08-11. You can view files and clone it, but cannot push or open issues or pull requests.
Gishen-Mob/components/prescription/RxQueriedPanel.tsx
kirukib d40cb22ff4 Finalize profile, prescription, and checkout with shared UI modules.
Add payment/notification prefs, assisted pharmacist codes, Rx status journey, and mock payment intents so demo flows match the storefront brief.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-10 14:53:34 +03:00

65 lines
1.8 KiB
TypeScript

import { useState } from "react";
import { View } from "react-native";
import { Button } from "@/components/ui/Button";
import { Card } from "@/components/ui/Card";
import { Field } from "@/components/ui/Field";
import { Text } from "@/components/ui/Text";
import { colors } from "@/lib/theme";
export function RxQueriedPanel({
pharmacistMessage,
customerReply,
onReply,
}: {
pharmacistMessage?: string;
customerReply?: string;
onReply: (message: string) => void;
}) {
const [reply, setReply] = useState(customerReply ?? "");
return (
<Card tone="brand" elevated={false}>
<Text variant="h3">Pharmacist needs clarification</Text>
<Text variant="bodySm" color={colors.muted} style={{ marginTop: 6 }}>
{pharmacistMessage ||
"Please confirm dosage, patient name, or upload a clearer page."}
</Text>
{customerReply ? (
<View
style={{
marginTop: 12,
padding: 12,
borderRadius: 12,
backgroundColor: colors.surface,
borderWidth: 1,
borderColor: colors.line,
}}
>
<Text variant="caption" color={colors.subtle}>
Your reply
</Text>
<Text variant="bodySm" style={{ marginTop: 4 }}>
{customerReply}
</Text>
</View>
) : (
<View style={{ marginTop: 12, gap: 10 }}>
<Field
label="Your reply"
value={reply}
onChangeText={setReply}
placeholder="Clarify dose, brand preference, or re-upload note…"
/>
<Button
title="Send reply"
onPress={() => {
if (!reply.trim()) return;
onReply(reply.trim());
}}
/>
</View>
)}
</Card>
);
}