Small refactoring
All checks were successful
Deploy to production / build (push) Successful in 1m1s

This commit is contained in:
Sean Edmunds
2026-02-10 12:59:54 -06:00
parent 28802c8698
commit dd5e3dd4f3
38 changed files with 968 additions and 974 deletions

View File

@@ -18,7 +18,7 @@ import type { WolClient } from 'types';
import DebouncedWolClient from './DebouncedWolClient';
import WolClientSettingsItem from './WolClientSettingsItem';
const WolClientSettings = () => {
export function WolClients() {
const defaultWolClient: WolClient = {
id: undefined,
hostname: '',
@@ -65,76 +65,78 @@ const WolClientSettings = () => {
return (
<Stack>
<AddItemModal
modalOpened={modalOpened}
handleClose={handleClose}
title={'Add a new WoL Client'}
body={
<form
onSubmit={form.onSubmit((values) => {
mutateAsync({
method: 'POST',
endpoint: endpoint,
body: values,
});
handleClose();
})}
>
<Stack gap={0} w={'100%'} align='center'>
<Group w={'100%'} justify='center'>
<TextInput
key={form.key('hostname')}
{...form.getInputProps('hostname')}
label={'Hostname'}
placeholder='eg. Workstation'
className={textInputClasses.settingsItem}
classNames={textInputClasses}
withAsterisk
styles={
theme.textShadowsEnabled
? {
label: { boxShadow: '2px 2px var(--mantine-color-border-0)' },
}
: undefined
}
/>
<TextInput
key={form.key('macAddress')}
{...form.getInputProps('macAddress')}
label={'MAC Address'}
placeholder='eg. 00:00:00:00:00:00'
className={textInputClasses.settingsItem}
classNames={textInputClasses}
withAsterisk
styles={
theme.textShadowsEnabled
? {
label: { boxShadow: '2px 2px var(--mantine-color-border-0)' },
}
: undefined
}
/>
</Group>
<Group mt={'1rem'}>
<Button
type='submit'
className={buttonClasses.saveButton}
classNames={buttonClasses}
>
Save
</Button>
<Button
className={buttonClasses.cancelButton}
classNames={buttonClasses}
onClick={handleClose}
>
Cancel
</Button>
</Group>
</Stack>
</form>
}
/>
{modalOpened && (
<AddItemModal
modalOpened={modalOpened}
handleClose={handleClose}
title={'Add a new WoL Client'}
body={
<form
onSubmit={form.onSubmit((values) => {
mutateAsync({
method: 'POST',
endpoint: endpoint,
body: values,
});
handleClose();
})}
>
<Stack gap={0} w={'100%'} align='center'>
<Group w={'100%'} justify='center'>
<TextInput
key={form.key('hostname')}
{...form.getInputProps('hostname')}
label={'Hostname'}
placeholder='eg. Workstation'
className={textInputClasses.settingsItem}
classNames={textInputClasses}
withAsterisk
styles={
theme.textShadowsEnabled
? {
label: { boxShadow: '2px 2px var(--mantine-color-border-0)' },
}
: undefined
}
/>
<TextInput
key={form.key('macAddress')}
{...form.getInputProps('macAddress')}
label={'MAC Address'}
placeholder='eg. 00:00:00:00:00:00'
className={textInputClasses.settingsItem}
classNames={textInputClasses}
withAsterisk
styles={
theme.textShadowsEnabled
? {
label: { boxShadow: '2px 2px var(--mantine-color-border-0)' },
}
: undefined
}
/>
</Group>
<Group mt={'1rem'}>
<Button
type='submit'
className={buttonClasses.saveButton}
classNames={buttonClasses}
>
Save
</Button>
<Button
className={buttonClasses.cancelButton}
classNames={buttonClasses}
onClick={handleClose}
>
Cancel
</Button>
</Group>
</Stack>
</form>
}
/>
)}
<SettingsHeader
setDragging={undefined}
openModal={openModal}
@@ -204,5 +206,4 @@ const WolClientSettings = () => {
</Stack>
</Stack>
);
};
export default WolClientSettings;
}