import { type ComponentPropsWithoutRef, type ReactNode } from 'react'; export interface ReviewItem { id: string; /** When the review was authored (ISO 8601). */ authoredAt: string; /** Anonymised author display ("Marco T.", "Anna_M"). Falls back to a localised "Anonymous". */ pseudonym?: string; /** 0..max — drives the visible star summary on the compact card. */ overallScore: number; /** Short free-text comment shown on the compact card. */ comment?: string; /** Practice reply (revealed in the expanded panel only). */ reply?: string; /** Optional per-axis breakdown — when present, the card grows an * "Expand" affordance that reveals these in a DescriptionList. */ breakdown?: { appointmentScore?: number; communicationScore?: number; staffScore?: number; overallScore?: number; }; /** Optional categorical follow-ups, surfaced inside the breakdown. */ futureVisit?: 'yes' | 'no' | 'unsure'; recommendation?: 'yes' | 'no' | 'unsure'; } export interface ReviewsAggregate { /** Total review count across all star buckets (may exceed the loaded set when paginated). */ count: number; /** Average score across the full population (drives the header `Rating`). */ averageScore: number; /** * Optional histogram — per-bucket count keyed by integer star value 1..5. * When omitted, the panel derives buckets from the loaded `reviews` array * (best-effort: paginated consumers SHOULD provide this explicitly). */ histogram?: Record<1 | 2 | 3 | 4 | 5, number>; } export type ReviewFilter = 'all' | 1 | 2 | 3 | 4 | 5; export interface ReviewsPanelHandle { getFilter: () => ReviewFilter; setFilter: (next: ReviewFilter) => void; /** Total visible after filter is applied. */ getVisibleCount: () => number; } export interface ReviewsPanelProps extends Omit, 'aria-label' | 'children'> { reviews: ReviewItem[]; aggregate: ReviewsAggregate; /** * Active star filter. Controlled — consumer owns it for shareability via * URL query strings. Omit for uncontrolled (panel-managed) filtering. */ filter?: ReviewFilter; onFilterChange?: (next: ReviewFilter) => void; /** * Optional intro callout shown above the list (e.g. "Riepilogo delle * opinioni — i pazienti raccontano…"). Render-prop slot so the consumer * can drop in `` / `` / plain `

`. */ introSlot?: ReactNode; /** Optional header right-end action (e.g. a "Leave a review" button). */ headerActionSlot?: ReactNode; /** Override the default region aria-label. */ 'aria-label'?: string; /** Agent-readiness id. */ id?: string; className?: string; /** * Hide the filter sidebar — useful when the panel mounts under ~640px * width or inside a narrow column. Defaults to false. */ hideFilter?: boolean; /** * @default 'flat' * `'elevated'` wraps the panel in the equivalent of `Card variant="elevated"` * — same tokens (`--card`, `--card-border`, `--shadow-card`, * `--radius-lg`), same padding. Use to drop the consumer-side * `` wrap. */ surface?: 'flat' | 'elevated'; /** Render skeletons for the header and the list. */ loading?: boolean; } export declare const ReviewsPanel: import("react").ForwardRefExoticComponent>; //# sourceMappingURL=reviews-panel.d.ts.map