feat: add create/edit link form + controller methods

This commit is contained in:
Sonny
2024-05-18 00:55:27 +02:00
committed by Sonny
parent 8176817030
commit 3c2c5dcee6
23 changed files with 421 additions and 147 deletions

View File

@@ -1,14 +1,8 @@
import styled from '@emotion/styled';
import { ChangeEvent, InputHTMLAttributes, useState } from 'react';
import FormField from '~/components/common/form/_form_field';
import FormFieldError from '~/components/common/form/_form_field_error';
import Input from '~/components/common/form/_input';
// TODO: create a global style variable (fontSize)
const InputLegend = styled.p(({ theme }) => ({
fontSize: '12px',
color: theme.colors.lightRed,
}));
interface InputProps
extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
label: string;
@@ -49,7 +43,7 @@ export default function TextBox({
placeholder={props.placeholder ?? 'Type something...'}
/>
{errors.length > 0 &&
errors.map((error) => <InputLegend>{error}</InputLegend>)}
errors.map((error) => <FormFieldError>{error}</FormFieldError>)}
</FormField>
);
}