refactor: reorder settings form fields and improve code formatting
This commit is contained in:
parent
d0ee05a148
commit
abeff9963a
@ -1,15 +1,15 @@
|
|||||||
import { Head, useForm } from '@inertiajs/react';
|
|
||||||
import { ImagePlus, X, Save, Loader } from 'lucide-react';
|
|
||||||
import React, { useRef, useState } from 'react';
|
|
||||||
import { toast } from 'sonner';
|
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||||
import { Field, FieldError } from "@/components/ui/field"
|
import { Field, FieldError } from "@/components/ui/field";
|
||||||
import { Input } from "@/components/ui/input"
|
import { Input } from "@/components/ui/input";
|
||||||
import { Label } from "@/components/ui/label"
|
import { Label } from "@/components/ui/label";
|
||||||
import { Textarea } from '@/components/ui/textarea';
|
import { Textarea } from '@/components/ui/textarea';
|
||||||
import systemRoutes from '@/routes/system';
|
import systemRoutes from '@/routes/system';
|
||||||
import type { GeneralSetting } from '@/types';
|
import type { GeneralSetting } from '@/types';
|
||||||
|
import { Head, useForm } from '@inertiajs/react';
|
||||||
|
import { ImagePlus, Loader, Save, X } from 'lucide-react';
|
||||||
|
import React, { useRef, useState } from 'react';
|
||||||
|
import { toast } from 'sonner';
|
||||||
|
|
||||||
export default function SettingIndex({ setting }: { setting: GeneralSetting | null }) {
|
export default function SettingIndex({ setting }: { setting: GeneralSetting | null }) {
|
||||||
const { data, setData, post, processing, errors } = useForm({
|
const { data, setData, post, processing, errors } = useForm({
|
||||||
@ -99,6 +99,18 @@ iconInputRef.current.value = '';
|
|||||||
<CardTitle>Informasi Aplikasi</CardTitle>
|
<CardTitle>Informasi Aplikasi</CardTitle>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent className="space-y-6">
|
<CardContent className="space-y-6">
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||||
|
<Field>
|
||||||
|
<Label htmlFor="phone" required>No. Telepon</Label>
|
||||||
|
<Input
|
||||||
|
id="phone"
|
||||||
|
value={data.phone || ''}
|
||||||
|
onChange={(e) => setData('phone', e.target.value)}
|
||||||
|
placeholder="0812xxxx"
|
||||||
|
/>
|
||||||
|
<FieldError error={errors.phone} label="No. Telepon" className="text-xs" />
|
||||||
|
</Field>
|
||||||
|
|
||||||
<Field>
|
<Field>
|
||||||
<Label htmlFor="name" required>Nama Aplikasi</Label>
|
<Label htmlFor="name" required>Nama Aplikasi</Label>
|
||||||
<Input
|
<Input
|
||||||
@ -112,6 +124,7 @@ iconInputRef.current.value = '';
|
|||||||
/>
|
/>
|
||||||
<FieldError error={errors.name} label="Nama Aplikasi" className="text-xs" />
|
<FieldError error={errors.name} label="Nama Aplikasi" className="text-xs" />
|
||||||
</Field>
|
</Field>
|
||||||
|
</div>
|
||||||
|
|
||||||
<Field>
|
<Field>
|
||||||
<Label htmlFor="description" required>Deskripsi</Label>
|
<Label htmlFor="description" required>Deskripsi</Label>
|
||||||
@ -125,19 +138,6 @@ iconInputRef.current.value = '';
|
|||||||
<FieldError error={errors.description} label="Deskripsi" className="text-xs mt-1" />
|
<FieldError error={errors.description} label="Deskripsi" className="text-xs mt-1" />
|
||||||
</Field>
|
</Field>
|
||||||
|
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
||||||
<Field>
|
|
||||||
<Label htmlFor="phone" required>No. Telepon</Label>
|
|
||||||
<Input
|
|
||||||
id="phone"
|
|
||||||
value={data.phone || ''}
|
|
||||||
onChange={(e) => setData('phone', e.target.value)}
|
|
||||||
placeholder="0812xxxx"
|
|
||||||
/>
|
|
||||||
<FieldError error={errors.phone} label="No. Telepon" className="text-xs" />
|
|
||||||
</Field>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Field>
|
<Field>
|
||||||
<Label htmlFor="address" required>Alamat</Label>
|
<Label htmlFor="address" required>Alamat</Label>
|
||||||
<Textarea
|
<Textarea
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user