File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed
platforms/metagram/src/lib/fragments/MessageInput Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -12,5 +12,7 @@ export default {
1212} ;
1313
1414export const Primary = {
15- args : { }
15+ args : {
16+ placeholder : 'Write your message'
17+ }
1618} ;
Original file line number Diff line number Diff line change 11<script lang =" ts" >
22 import { Avatar , Input } from ' $lib/ui' ;
3+ import { cn } from ' $lib/utils' ;
34 import { ImageAdd02Icon } from ' @hugeicons/core-free-icons' ;
45 import { HugeiconsIcon } from ' @hugeicons/svelte' ;
56 import type { HTMLAttributes } from ' svelte/elements' ;
89 src: string ;
910 value: string ;
1011 placeholder? : string ;
12+ files? : FileList | undefined ;
1113 }
1214
1315 let {
1416 src = ' https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250' ,
1517 value,
16- placeholder
18+ placeholder,
19+ files = $bindable (),
20+ ... restProps
1721 }: IMessageInputProps = $props ();
1822
19- let files: FileList | undefined = $state ();
20-
21- $effect (() => {
22- console .log (files );
23- });
23+ const cBase = ' flex items-center justify-between gap-2' ;
2424 </script >
2525
26- <div class =" flex items-center justify-between gap-2 " >
26+ <div {... restProps } class ={ cn ([ cBase , restProps . class ]. join ( ' ' ))} >
2727 <Avatar size ="sm" {src } />
28- <Input type =" text" bind:value placeholder = " Type your message " />
28+ <Input type ="text" bind:value { placeholder } />
2929 <div class =" bg-grey flex aspect-square h-13 w-13 items-center justify-center rounded-full" >
3030 <input id =" add-image" type =" file" class =" hidden" accept =" image/*" bind:files />
3131 <label for =" add-image" >
You can’t perform that action at this time.
0 commit comments