Skip to content

Commit

Permalink
Update CrystalDiffraction.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
HWJones authored Dec 12, 2024
1 parent 5fb7194 commit 0429750
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions components/CrystalDiffraction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

import React, { useState, useEffect } from 'react';

const Button = ({ onClick, children, className = "" }) => (
const Button = ({
onClick,
children,
className = ""
}: {
onClick: () => void;
children: React.ReactNode;
className?: string;
}) => (
<button
onClick={onClick}
className={`px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 ${className}`}
Expand All @@ -11,7 +19,19 @@ const Button = ({ onClick, children, className = "" }) => (
</button>
);

const Slider = ({ label, value, onChange, min, max }) => (
const Slider = ({
label,
value,
onChange,
min,
max
}: {
label: string;
value: number;
onChange: (value: number) => void;
min: number;
max: number;
}) => (
<div className="mb-4">
<label className="block mb-2">{label}</label>
<input
Expand Down

0 comments on commit 0429750

Please sign in to comment.