-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use textarea for longer additional promtp
- Loading branch information
Showing
3 changed files
with
40 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import type { ComponentProps } from "react"; | ||
import { TextareaControl } from "@wordpress/components"; | ||
import { __, _x } from "@wordpress/i18n"; | ||
|
||
interface AdditionalPromptControlProps | ||
extends ComponentProps<typeof TextareaControl> {} | ||
|
||
export default function AdditionalPromptControl({ | ||
rows = 1, | ||
...props | ||
}: AdditionalPromptControlProps) { | ||
return ( | ||
<TextareaControl | ||
rows={rows} | ||
label={__( | ||
"Additional prompt (optional)", | ||
"alt-text-generator-gpt-vision", | ||
)} | ||
help={__( | ||
"Provide additional instructions for AI to tailor the alt text generation, such as including specific keywords for SEO.", | ||
"alt-text-generator-gpt-vision", | ||
)} | ||
placeholder={_x( | ||
'e.g. Include terms like "AI", "robotics"', | ||
"Additional prompt placeholder", | ||
"alt-text-generator-gpt-vision", | ||
)} | ||
style={{ | ||
fieldSizing: "content", | ||
maxHeight: "8em", | ||
}} | ||
{...props} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters