refactor: icon picker add asterisk option (#2496)

* fix: added `withAsterisk` property to `IconPicker`, defaulted to true so it's backwards compatible

* fix: `icon-picker.tsx` formatting

---------

Co-authored-by: Andre Silva <asilva01@acuitysso.com>
This commit is contained in:
Andre Silva
2025-03-28 09:18:52 +00:00
committed by GitHub
parent 84f73d33a0
commit b054bdd987

View File

@@ -33,9 +33,17 @@ interface IconPickerProps {
error?: string | null;
onFocus?: FocusEventHandler;
onBlur?: FocusEventHandler;
withAsterisk?: boolean;
}
export const IconPicker = ({ value: propsValue, onChange, error, onFocus, onBlur }: IconPickerProps) => {
export const IconPicker = ({
value: propsValue,
onChange,
error,
onFocus,
onBlur,
withAsterisk = true,
}: IconPickerProps) => {
const [value, setValue] = useUncontrolled({
value: propsValue,
onChange,
@@ -145,7 +153,7 @@ export const IconPicker = ({ value: propsValue, onChange, error, onFocus, onBlur
setSearch(value || "");
}}
rightSectionPointerEvents="none"
withAsterisk
withAsterisk={withAsterisk}
error={error}
label={tCommon("iconPicker.label")}
placeholder={tCommon("iconPicker.header", { countIcons: String(data?.countIcons ?? 0) })}