forked from aws-samples/amplify-next-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #253 from cabcookie:add-a-note-to-payer-accounts
feat: add AWS Payer ID erhält ein zusätzliches Notizfelda note to an AWS Payer ID
- Loading branch information
Showing
6 changed files
with
74 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Payer } from "@/api/usePayer"; | ||
import { cn } from "@/lib/utils"; | ||
import { FC, useEffect, useState } from "react"; | ||
import { Button } from "../ui/button"; | ||
import { Input } from "../ui/input"; | ||
|
||
type NotesInputProps = { | ||
payer: Payer | undefined; | ||
onChange: (notes: string) => void; | ||
className?: string; | ||
}; | ||
|
||
const NotesInput: FC<NotesInputProps> = ({ payer, onChange, className }) => { | ||
const [notes, setNotes] = useState(""); | ||
|
||
useEffect(() => { | ||
setNotes(payer?.notes ?? ""); | ||
}, [payer]); | ||
|
||
return ( | ||
<div className={cn("space-y-1", className)}> | ||
<Input | ||
value={notes} | ||
onChange={(e) => setNotes(e.target.value)} | ||
placeholder="Add notes…" | ||
/> | ||
<Button | ||
disabled={notes === (payer?.notes ?? "")} | ||
onClick={() => onChange(notes)} | ||
size="sm" | ||
> | ||
Save | ||
</Button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default NotesInput; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters