import { AlertTriangle, CheckCircle, Check, X } from "lucide-react" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { formatPrice, type CalculationDetails } from "@/lib/calculations" import { PRICES, CONSTRAINTS, FLOORING_TYPES } from "@/lib/constants" interface CalculationDetailsProps { details: CalculationDetails distanceSource?: "openrouteservice" | "table" | null } export function CalculationDetailsView({ details, distanceSource }: CalculationDetailsProps) { return ( Detaljeret Prisberegning Komplet oversigt over alle delpriser og beregninger {/* Input Values */}

Indtastede værdier

Gulvareal: {details.area} m²
Gulvhøjde: {details.height} cm
Postnummer: {details.postalCode}
Afstand (tur-retur): {details.distance} km
{/* Selected Components */}

Valgte komponenter

{details.includeInsulation ? ( ) : ( )} Isolering: {details.includeInsulation ? "Inkluderet" : "Fravalgt"}
{details.includeFloorHeating ? ( ) : ( )} Gulvvarme: {details.includeFloorHeating ? "Inkluderet" : "Fravalgt"}
{details.includeCompound ? ( ) : ( )} Gulvstøbning: {details.includeCompound ? "Inkluderet" : "Fravalgt"}
{details.includeCompound && (
Gulvbelægning: {FLOORING_TYPES[details.flooringType]?.name || details.flooringType}
)}
{/* Calculated Values */}

Beregnede værdier

Isoleringstykkelse: {details.insulationThickness} cm ({details.height} -{" "} {CONSTRAINTS.CONCRETE_THICKNESS} cm beton)
Isoleringsvolumen: {details.insulationVolume.toFixed(2)} m³
Spartelvægt: {details.compoundWeight.toLocaleString("da-DK")} kg ({details.area} m² ×{" "} {PRICES.COMPOUND_WEIGHT_PER_M2} kg/m²)
{/* Component Prices */}

Komponent priser

Isolering{" "} {details.includeInsulation ? details.insulationThickness > 0 ? `(${details.insulationVolume.toFixed(2)} m³ × ${formatPrice(PRICES.INSULATION_TOTAL_PER_M3)}/m³)` : "(simpel arbejdsløn)" : "(fravalgt)"} : {formatPrice(details.insulation)}
Gulvvarme{" "} {details.includeFloorHeating ? `(${details.area} m² × ${formatPrice(PRICES.FLOOR_HEATING_TOTAL)}/m²)` : "(fravalgt)"} : {formatPrice(details.floorHeating)}
Syntetisk net{" "} {details.includeFloorHeating ? `(${details.area} m² × ${formatPrice(PRICES.SYNTHETIC_NET_TOTAL)}/m²)` : "(fravalgt)"} : {formatPrice(details.syntheticNet)}
Flydespartel{" "} {details.includeCompound ? `(${details.area} m² × ${formatPrice(PRICES.SELF_LEVELING_COMPOUND)}/m²${FLOORING_TYPES[details.flooringType]?.compoundMultiplier > 1 ? " +28%" : ""})` : "(fravalgt)"} : {formatPrice(details.selfLevelingCompound)}
Pumpebil-tillæg{" "} {details.includeCompound ? `(${details.compoundWeight.toLocaleString("da-DK")} kg)` : "(fravalgt)"} : {formatPrice(details.pumpTruckFee)}
Startgebyr: {formatPrice(details.startFee)}
{/* Subtotal and Fees */}

Subtotal og tillæg

Subtotal: {formatPrice(details.subtotal)}
Afdækning ({(PRICES.COVERING_PERCENTAGE * 100).toFixed(1)}%): {formatPrice(details.coveringFee)}
Affald ({(PRICES.WASTE_PERCENTAGE * 100).toFixed(2)}%): {formatPrice(details.wasteFee)}
Tillæg i alt: {formatPrice(details.totalFees)}
{/* Transport */}

Transport

Kørsel ({details.distance} km × {formatPrice(PRICES.TRANSPORT_PER_KM)}/km): {formatPrice(details.transport)}
{details.bridgeFee > 0 && (
Storebælt-tillæg: {formatPrice(details.bridgeFee)}
)} {distanceSource && (
{distanceSource === "openrouteservice" ? ( <> Præcis afstand via OpenRouteService ) : ( <> Præcis afstandsberegning ikke mulig - overslag brugt )}
)}
{/* Final Total */}

Total

Total ekskl. moms: {formatPrice(details.totalExclVat)}
Moms (25%): {formatPrice(details.vat)}
Total inkl. moms: {formatPrice(details.totalInclVat)}
) }