Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
7
- Always use functional components with **named exports**.
Sign in to like and favorite skills
const over let.===.any; prefer unknown or well-defined types.useEffect cleanup function.import React from 'react'; type PrimaryButtonProps = { /** Text shown inside the button */ label: string; /** Called when the button is pressed */ onPress: () => void; }; export const PrimaryButton: React.FC<PrimaryButtonProps> = ({ label, onPress }) => { const handleClick = () => { onPress(); }; return ( <button type="button" className="rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700" onClick={handleClick} > {label} </button> ); };
/** Maps numeric brightness values into a normalized gain range */ export const mapBrightnessToGain = (brightnessValues: number[]): number[] => { const maxValue = Math.max(...brightnessValues); const minValue = Math.min(...brightnessValues); const range = Math.max(maxValue - minValue, 1); return brightnessValues.map((value) => { const normalized = (value - minValue) / range; return Number(normalized.toFixed(3)); }); };