mirror of
https://github.com/spliit-app/spliit.git
synced 2026-03-02 11:26:11 +01:00
Empty state
This commit is contained in:
@@ -49,7 +49,9 @@ export default async function GroupPage({
|
|||||||
</Button>
|
</Button>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<CardContent className="p-0">
|
<CardContent className="p-0">
|
||||||
|
{expenses.length > 0 ? (
|
||||||
<Table className="">
|
<Table className="">
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
@@ -85,7 +87,7 @@ export default async function GroupPage({
|
|||||||
))}
|
))}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell className="text-right tabular-nums">
|
<TableCell className="text-right tabular-nums">
|
||||||
$ {expense.amount.toFixed(2)}
|
$ {expense.amount.toFixed(2)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<Button
|
<Button
|
||||||
@@ -105,6 +107,9 @@ export default async function GroupPage({
|
|||||||
))}
|
))}
|
||||||
</TableBody>
|
</TableBody>
|
||||||
</Table>
|
</Table>
|
||||||
|
) : (
|
||||||
|
<div className="p-6">Your group doesn’t have any expense yet.</div>
|
||||||
|
)}
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
|
|||||||
@@ -56,12 +56,12 @@ export function ExpenseForm({ group, expense, onSubmit }: Props) {
|
|||||||
<CardHeader>
|
<CardHeader>
|
||||||
<CardTitle>Expense information</CardTitle>
|
<CardTitle>Expense information</CardTitle>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent className="grid grid-cols-2 gap-6">
|
<CardContent className="grid grid-cols-1 sm:grid-cols-2 gap-6">
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="title"
|
name="title"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem className="order-1">
|
||||||
<FormLabel>Expense title</FormLabel>
|
<FormLabel>Expense title</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input placeholder="Monday evening restaurant" {...field} />
|
<Input placeholder="Monday evening restaurant" {...field} />
|
||||||
@@ -78,7 +78,7 @@ export function ExpenseForm({ group, expense, onSubmit }: Props) {
|
|||||||
control={form.control}
|
control={form.control}
|
||||||
name="paidBy"
|
name="paidBy"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem className="order-3 sm:order-2">
|
||||||
<FormLabel>Paid by</FormLabel>
|
<FormLabel>Paid by</FormLabel>
|
||||||
<Select
|
<Select
|
||||||
onValueChange={field.onChange}
|
onValueChange={field.onChange}
|
||||||
@@ -107,7 +107,7 @@ export function ExpenseForm({ group, expense, onSubmit }: Props) {
|
|||||||
control={form.control}
|
control={form.control}
|
||||||
name="amount"
|
name="amount"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem className="order-2 sm:order-3">
|
||||||
<FormLabel>Amount</FormLabel>
|
<FormLabel>Amount</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input
|
<Input
|
||||||
@@ -128,7 +128,7 @@ export function ExpenseForm({ group, expense, onSubmit }: Props) {
|
|||||||
control={form.control}
|
control={form.control}
|
||||||
name="paidFor"
|
name="paidFor"
|
||||||
render={() => (
|
render={() => (
|
||||||
<FormItem>
|
<FormItem className="order-4">
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<FormLabel>Paid for</FormLabel>
|
<FormLabel>Paid for</FormLabel>
|
||||||
<FormDescription>
|
<FormDescription>
|
||||||
|
|||||||
Reference in New Issue
Block a user