Home / File/ _Ticket.tsx — astro Source File

_Ticket.tsx — astro Source File

Architecture documentation for _Ticket.tsx, a tsx file in the astro codebase. 6 imports, 0 dependents.

File tsx CoreAstro RoutingSystem 6 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  a5929905_a7c2_240f_3079_bacf2ad2ad3d["_Ticket.tsx"]
  6986db32_b74e_37a6_ff49_3275e975c4fb["Form.tsx"]
  a5929905_a7c2_240f_3079_bacf2ad2ad3d --> 6986db32_b74e_37a6_ff49_3275e975c4fb
  4ced467d_2434_ded6_1c62_a6986a7078d5["Form"]
  a5929905_a7c2_240f_3079_bacf2ad2ad3d --> 4ced467d_2434_ded6_1c62_a6986a7078d5
  08b8f296_1046_95c9_b1e8_5b5084fb91b3["Input"]
  a5929905_a7c2_240f_3079_bacf2ad2ad3d --> 08b8f296_1046_95c9_b1e8_5b5084fb91b3
  c2e57772_bac6_7f43_6c14_f859a976c049["simple:form"]
  a5929905_a7c2_240f_3079_bacf2ad2ad3d --> c2e57772_bac6_7f43_6c14_f859a976c049
  d9988dd0_c044_f9d2_85cd_a31a0a2bdf80["react"]
  a5929905_a7c2_240f_3079_bacf2ad2ad3d --> d9988dd0_c044_f9d2_85cd_a31a0a2bdf80
  f8c9251e_f535_6281_2118_9e79a4155212["v4"]
  a5929905_a7c2_240f_3079_bacf2ad2ad3d --> f8c9251e_f535_6281_2118_9e79a4155212
  style a5929905_a7c2_240f_3079_bacf2ad2ad3d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { createForm } from 'simple:form';
import { useState } from 'react';
import * as z from 'zod/v4';
import { Form, Input } from '../../components/Form';

export const ticketForm = createForm({
	email: z.email(),
	quantity: z.number().max(10),
	newsletter: z.boolean(),
});

export function TicketForm({ price }: { price: number }) {
	const [quantity, setQuantity] = useState(1);
	return (
		<>
			<Form validator={ticketForm.validator}>
				<h3>${(quantity * price) / 100}</h3>

				<label htmlFor="quantity">Quantity</label>
				<Input
					id="quantity"
					{...ticketForm.inputProps.quantity}
					onInput={(e) => {
						const value = Number(e.currentTarget.value);
						setQuantity(value);
					}}
				/>

				<label htmlFor="email">Email</label>
				<Input id="email" {...ticketForm.inputProps.email} />

				<div className="newsletter">
					<Input id="newsletter" {...ticketForm.inputProps.newsletter} />
					<label htmlFor="newsletter">Hear about the next event in your area</label>
				</div>
				<button>Buy tickets</button>
			</Form>
		</>
	);
}

Domain

Subdomains

Functions

Dependencies

Frequently Asked Questions

What does _Ticket.tsx do?
_Ticket.tsx is a source file in the astro codebase, written in tsx. It belongs to the CoreAstro domain, RoutingSystem subdomain.
What functions are defined in _Ticket.tsx?
_Ticket.tsx defines 1 function(s): TicketForm.
What does _Ticket.tsx depend on?
_Ticket.tsx imports 6 module(s): Form, Form.tsx, Input, react, simple:form, v4.
Where is _Ticket.tsx in the architecture?
_Ticket.tsx is located at packages/db/test/fixtures/ticketing-example/src/pages/[event]/_Ticket.tsx (domain: CoreAstro, subdomain: RoutingSystem, directory: packages/db/test/fixtures/ticketing-example/src/pages/[event]).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free