website icon indicating copy to clipboard operation
website copied to clipboard

Add TypeScript prop types to PageHeader component

Open mohanadft opened this issue 2 months ago • 3 comments

Description

Components that accept props should have proper TypeScript interfaces or types defined for better type safety and developer experience.

Task

Review the PageHeader component and ensure it has:

  1. A proper TypeScript interface defining all props
  2. Exported types so other components can use them
  3. Optional/required props clearly marked
  4. JSDoc comments explaining what each prop does

Find the Component

Look for PageHeader.astro or PageHeader.tsx in:

  • src/components/

Example Structure

interface PageHeaderProps {
  /** Main title of the page */
  title: string;
  /** Optional subtitle providing additional context */
  subtitle?: string;
  /** Small overline text above the title */
  overline?: string;
}

export default function PageHeader({ title, subtitle, overline }: PageHeaderProps) {
  // component implementation
}

Acceptance Criteria

  • [ ] Props interface is defined
  • [ ] All props have JSDoc comments
  • [ ] Optional vs required props are clear
  • [ ] Types are exported for reuse
  • [ ] No TypeScript errors

Why This Matters

  • Better autocomplete in IDEs
  • Catches bugs at compile time
  • Makes the component easier to use
  • Self-documenting code

Great way to learn TypeScript interfaces and JSDoc!

mohanadft avatar Nov 13 '25 14:11 mohanadft