Add missing label

This commit is contained in:
Marcus Blättermann 2023-01-24 09:48:20 +01:00
parent 950fceceb6
commit e2404382be
No known key found for this signature in database
GPG Key ID: A1E1F04008AC450D
2 changed files with 7 additions and 2 deletions

View File

@ -14,7 +14,7 @@ export function copyToClipboard(ref, callback) {
}
}
export default function CopyInput({ text, prefix }) {
export default function CopyInput({ text, description, prefix }) {
const isClient = typeof window !== 'undefined'
const [supportsCopy, setSupportsCopy] = useState(false)
@ -41,6 +41,7 @@ export default function CopyInput({ text, prefix }) {
defaultValue={text}
rows={1}
onClick={selectText}
aria-label={description}
/>
{supportsCopy && (
<button title="Copy to clipboard" onClick={onClick}>

View File

@ -29,7 +29,11 @@ export default function Project({
return (
<Infobox title={header} emoji="🪐">
{children}
<CopyInput text={text} prefix="$" />
<CopyInput
text={text}
prefix="$"
description="Example bash command to start with an end-to-end template"
/>
</Infobox>
)
}