mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 20:27:23 +00:00
Add server configuration management.
This commit is contained in:
@@ -1,8 +1,17 @@
|
||||
export function ErrorAlert({message, className}: {message: string, className?: string}) {
|
||||
export function ErrorAlert({ message, className }: { message: string, className?: string }) {
|
||||
return <div role="alert" className={`alert alert-error ${className}`}>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" className="h-6 w-6 shrink-0 stroke-current" fill="none" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
||||
d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" />
|
||||
</svg>
|
||||
<span>{message}</span>
|
||||
</div>;
|
||||
}
|
||||
|
||||
export function InfoAlert({ message, className }: { message: string, className?: string }) {
|
||||
return <div role="alert" className={`alert alert-info ${className}`}>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="h-6 w-6 shrink-0 stroke-current">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
||||
</svg>
|
||||
<span>{message}</span>
|
||||
</div>;
|
||||
|
22
frontend/src/components/input.tsx
Normal file
22
frontend/src/components/input.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
interface InputProps {
|
||||
type?: string;
|
||||
placeholder?: string;
|
||||
value: string;
|
||||
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
||||
label: string;
|
||||
inlineLabel?: boolean;
|
||||
}
|
||||
|
||||
export default function Input(props: InputProps) {
|
||||
if (props.inlineLabel) {
|
||||
return <label className="input w-full">
|
||||
{props.label}
|
||||
<input type={props.type} className="grow" placeholder={props.placeholder} value={props.value} onChange={props.onChange} />
|
||||
</label>
|
||||
} else {
|
||||
return <fieldset className="fieldset w-full">
|
||||
<legend className="fieldset-legend">{props.label}</legend>
|
||||
<input type={props.type} className="input w-full" placeholder={props.placeholder} value={props.value} onChange={props.onChange} />
|
||||
</fieldset>
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user