import { Icon } from "./icon"; interface Field { label: string; value: string | number | boolean | null; type?: "text" | "code" | "json" | "boolean"; } interface MobileDetailViewProps { title: string; subtitle?: string; fields: Field[]; onEdit: () => void; onDelete: () => void; onBack: () => void; } export const MobileDetailView: React.FC = ({ title, subtitle, fields, onEdit, onDelete, onBack, }) => { const renderValue = (field: Field) => { if (field.value === null || field.value === undefined) { return Not set; } if (field.type === "boolean") { return field.value ? ( Yes ) : ( No ); } if (field.type === "code" || field.type === "json") { return (
          {typeof field.value === "string" ? field.value : JSON.stringify(field.value, null, 2)}
        
); } return {String(field.value)}; }; return (

{title}

{subtitle &&

{subtitle}

}
{fields.map((field, index) => (
{renderValue(field)}
))}
); };