feat(plugin): MoreStickers

This commit is contained in:
Leko 2024-10-19 10:34:20 +08:00
parent 45002e2ad7
commit 7ff4d9e818
No known key found for this signature in database
GPG key ID: 807BCB295D69CF0A
26 changed files with 3015 additions and 2 deletions

View file

@ -34,13 +34,15 @@ interface TextInputProps {
* Otherwise, return a string containing the reason for this input being invalid
*/
validate(v: string): true | string;
placeholder?: string;
}
/**
* A very simple wrapper around Discord's TextInput that validates input and shows
* the user an error message and only calls your onChange when the input is valid
*/
export function CheckedTextInput({ value: initialValue, onChange, validate }: TextInputProps) {
export function CheckedTextInput({ value: initialValue, onChange, validate, placeholder }: TextInputProps) {
const [value, setValue] = React.useState(initialValue);
const [error, setError] = React.useState<string>();
@ -62,6 +64,7 @@ export function CheckedTextInput({ value: initialValue, onChange, validate }: Te
value={value}
onChange={handleChange}
error={error}
placeholder={placeholder}
/>
</>
);