All files / src/components/projects/form-sections AdditionalInfoSection.tsx

100% Statements 3/3
100% Branches 0/0
100% Functions 3/3
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49                                  18x                 3x                           29x                
import { Checkbox } from "../../ui/checkbox";
import { Field, HelpText, Label } from "../../ui/field";
import { Textarea } from "../../ui/textarea";
 
interface AdditionalInfoSectionProps {
	useRooms: boolean;
	clientTestimonial: string;
	onUseRoomsChange: (value: boolean) => void;
	onClientTestimonialChange: (value: string) => void;
}
 
export function AdditionalInfoSection({
	useRooms,
	clientTestimonial,
	onUseRoomsChange,
	onClientTestimonialChange,
}: AdditionalInfoSectionProps) {
	return (
		<div className="space-y-4">
			<h3 className="border-b border-border-strong pb-1.5 text-xs font-semibold uppercase tracking-wider text-foreground-muted">
				Additional information
			</h3>
 
			<Field>
				<Checkbox
					checked={useRooms}
					onChange={(e) => onUseRoomsChange(e.target.checked)}
				>
					Enable room organisation
				</Checkbox>
				<HelpText className="ml-6">
					Organise photos by room (kitchen, bedroom, living room)
				</HelpText>
			</Field>
 
			<Field controlId="client-testimonial">
				<Label optional>Client testimonial</Label>
				<Textarea
					id="client-testimonial"
					value={clientTestimonial}
					onChange={(e) => onClientTestimonialChange(e.target.value)}
					placeholder="What the family said about the finished home."
					rows={3}
				/>
			</Field>
		</div>
	);
}