Move app to apps/web-react in pnpm workspace layout

This commit is contained in:
Kalle
2026-08-16 09:20:33 +03:00
parent 7e365ccfcf
commit bbc8ea57af
2913 changed files with 227 additions and 250 deletions

View File

@@ -0,0 +1,42 @@
import { WeaponSelect } from "~/components/WeaponSelect";
import type { MainWeaponId } from "~/modules/in-game-lists/types";
import type { FormFieldProps } from "../types";
import { FormFieldMessages, useTranslatedTexts } from "./FormFieldWrapper";
import styles from "./WeaponSelectFormField.module.css";
type WeaponSelectFormFieldProps = FormFieldProps<"weapon-select"> & {
value: MainWeaponId | null;
onChange: (value: MainWeaponId | null) => void;
disabled?: boolean;
};
export function WeaponSelectFormField({
name,
label,
bottomText,
error,
required,
value,
onChange,
onBlur,
disabled,
}: WeaponSelectFormFieldProps) {
const { translatedLabel } = useTranslatedTexts({ label });
return (
<div className={styles.root}>
<WeaponSelect
label={translatedLabel}
value={value}
onChange={(id) => {
onChange(id);
onBlur?.(id);
}}
isRequired={required}
clearable={!required}
isDisabled={disabled}
/>
<FormFieldMessages name={name} error={error} bottomText={bottomText} />
</div>
);
}