import React, { useState } from 'react';
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card';
import { Phone } from 'lucide-react';
const services = [
{
id: 'veterinar-remiss',
name: 'Veterinärundersökning via remiss',
description: 'Veterinärundersökning efter remiss.',
price: 850,
priceType: 'fixed',
notes: 'Kostnad för vidare behandling och provtagning tillkommer.'
},
{
id: 'kloklipp',
name: 'Kloklipp',
description: 'Kloklippning hos sköterska.',
priceType: 'contact',
notes: 'Ring för bokning.',
contactInfo: {
phone: '0406630630'
}
},
{
id: 'vaccination-skoterska',
name: 'Vaccination till sköterska',
description: 'Ej vid första besök eller rabiesvaccination. Max två djur per 15 min.',
priceRange: { min: 380, max: 722 },
priceType: 'range',
notes: 'Specialvacciner (Trilyme, Canileish, Herpesvaccin) kostar mer.'
},
{
id: 'blodprov-skoterska',
name: 'Blodprov till sköterska',
description: 'Endast återbesök efter rekommendation från veterinär.',
priceType: 'variable',
notes: 'Pris beror på provtyp.'
},
{
id: 'stygntagning',
name: 'Stygntagning till sköterska',
description: 'Stygntagning efter operation.',
priceType: 'contact',
notes: 'Benoperationer kräver veterinär – ring för bokning.',
contactInfo: {
phone: '0406630630'
}
},
{
id: 'hd-ad-rontgen',
name: 'HD/AD-röntgen',
description: 'För Svenska Kennelklubben eller Svenska Jakthundklubben.',
priceType: 'options',
options: [
{ name: '1 led', price: 1959 },
{ name: '2 leder', price: 2352 }
],
notes: 'Förbeställ röntgen hos SKK innan besök.',
links: {
skk: 'https://www.skk.se/uppfodning/halsa/leder/bestall-rontgenavlasning/'
}
},
{
id: 'avmaskning-resa',
name: 'Avmaskning inför resa',
description: 'Avmaskning för resa till Norge eller Finland.',
price: 293,
priceType: 'fixed',
notes: 'Pass och chipmärkning krävs.'
},
{
id: 'injektioner',
name: 'Cytopoint-/Artuvetrin-/Librelainjektioner',
description: 'Uppföljande injektioner hos sköterska.',
priceType: 'contact',
notes: 'Endast för djur med ordination från kliniken.',
contactInfo: {
phone: '0406630630'
}
},
{
id: 'tandkoll',
name: 'Tandkoll till veterinär',
description: 'Kontroll av tänder inför eventuell åtgärd.',
price: 520,
priceType: 'fixed',
notes: 'Blodprov och behandlingar tillkommer.'
},
{
id: 'veterinar-oron',
name: 'Veterinärundersökning - öron',
description: 'Första besök – öronundersökning.',
price: 850,
priceType: 'fixed',
notes: 'Provtagning och behandling tillkommer.'
},
{
id: 'draktighet-ultraljud',
name: 'Dräktighetsundersökning - ultraljud',
description: 'Ultraljud från dag 28.',
price: 880,
priceType: 'fixed',
notes: ''
},
{
id: 'draktighet-rontgen',
name: 'Dräktighetsundersökning - röntgen',
description: 'Röntgen efter ca 45-50 dagars dräktighet.',
price: 880,
priceType: 'fixed',
notes: ''
},
{
id: 'veterinar-senior',
name: 'Veterinärundersökning - seniorkoll',
description: 'Hälsokontroll för äldre djur.',
price: 850,
priceType: 'fixed',
notes: 'Provtagningar tillkommer.'
},
{
id: 'veterinar-knuta',
name: 'Veterinärundersökning - knuta',
description: 'Undersökning av knuta.',
price: 850,
priceType: 'fixed',
notes: 'Provtagning tillkommer.'
},
{
id: 'kastration-hane',
name: 'Kastration - hane',
description: 'Kastration av hanhund eller hankatt.',
priceType: 'animal',
prices: {
cat: 1000,
dog: { min: 3700, max: 4200 }
},
notes: 'Priset för hund beror på vikt. Kryptorkid-kastration har andra priser.'
},
{
id: 'kastration-tik',
name: 'Kastration - tik/hona',
description: 'Kastration av tik eller honkatt.',
priceType: 'animal',
prices: {
cat: 1700,
dog: { min: 6200, max: 8500 }
},
notes: 'Priset för hund beror på vikt. Dräktighet eller livmoderförändringar kan ge extra kostnad.'
},
{
id: 'ogonlysning',
name: 'Ögonlysning till veterinär',
description: 'Veterinärundersökning för ögonproblem.',
price: 1000,
priceType: 'fixed',
notes: 'Ring vid akuta besvär.',
contactInfo: {
phone: '0406630630'
}
},
{
id: 'vaccination-veterinar',
name: 'Vaccination till veterinär',
description: 'Vaccination inkl. hjärtkontroll. Max två djur per 15 min.',
priceRange: { min: 380, max: 722 },
priceType: 'range',
notes: 'Rabiesvaccination kräver pass.'
},
{
id: 'veterinar-sjukt',
name: 'Veterinärundersökning - sjukt djur',
description: 'Utredning av sjukdom (klåda, kräkning, diarré, hälta m.m.).',
price: 850,
priceType: 'fixed',
notes: 'Provtagning och behandling tillkommer.'
}
];
const ServiceCalculator = () => {
const [selectedService, setSelectedService] = useState('');
const [selectedOption, setSelectedOption] = useState('');
const [selectedAnimal, setSelectedAnimal] = useState('');
const service = services.find(s => s.id === selectedService);
const formatPhoneNumber = (phone) => {
return `${phone.slice(0,3)} ${phone.slice(3,6)} ${phone.slice(6)}`;
};
const renderPriceInput = () => {
if (!service) return null;
switch (service.priceType) {
case 'fixed':
return (
Pris: {service.price} kr
);
case 'range':
return (
Pris: {service.priceRange.min}-{service.priceRange.max} kr
);
case 'variable':
return (
Pris: Varierande
);
case 'contact':
return (
Pris: Kontakta kliniken
);
case 'options':
return (
Välj alternativ:
setSelectedOption(e.target.value)}
>
Välj...
{service.options.map(option => (
{option.name} - {option.price} kr
))}
{selectedOption && (
Pris: {service.options.find(opt => opt.name === selectedOption)?.price} kr
)}
);
case 'animal':
return (
Välj djurtyp:
setSelectedAnimal(e.target.value)}
>
Välj...
Katt
Hund
{selectedAnimal && (
Pris: {
selectedAnimal === 'cat'
? `${service.prices.cat} kr`
: `${service.prices.dog.min}-${service.prices.dog.max} kr`
}
)}
);
default:
return null;
}
};
const renderNotes = (service) => {
if (!service.notes) return null;
let notes = service.notes;
if (service.contactInfo?.phone) {
notes = notes.replace(
/ring för bokning/i,
`ring
${formatPhoneNumber(service.contactInfo.phone)}
för bokning`
);
}
if (service.links?.skk) {
notes = notes.replace(
'SKK',
`
SKK `
);
}
return (
);
};
return (
Priskalkylator för veterinärtjänster
Välj tjänst:
{
setSelectedService(e.target.value);
setSelectedOption('');
setSelectedAnimal('');
}}
>
Välj tjänst...
{services.map(service => (
{service.name}
))}
{service && (
<>
Beskrivning:
{service.description}
{renderPriceInput()}
{renderNotes(service)}
>
)}
);
};
export default ServiceCalculator;