22// biome-ignore lint/style/useConst: Svelte 5 $props() pattern
33let { additionalContext = $bindable (' ' ), expanded = $bindable (false ) } = $props ()
44 </script >
5-
6- <details class ="context-details" bind:open ={expanded }>
7- <summary >add more context</summary >
8- <textarea
9- class =" context-input"
10- rows =" 4"
11- bind:value ={additionalContext }
12- placeholder =" anything else we should know about?"
13- ></textarea >
14- </details >
15-
16- <style >
17- details .context-details {
18- text-align : left ;
19- border : 1px solid var (--light );
20- background-color : var (--white );
21- border-radius : var (--border-radius );
22- padding : 1rem ;
23- margin-bottom : 1rem ;
24- box-shadow : 0 2px 4px rgba (0 , 0 , 0 , 0.05 );
25- }
26-
27- details summary {
28- cursor : pointer ;
29- font-weight : 500 ;
30- }
31-
32- textarea .context-input {
33- font-family : var (--label-font );
34- width : 100% ;
35- margin-top : 0.75rem ;
36- padding : 0.75rem ;
37- border : 1px solid var (--light );
38- border-radius : var (--border-radius );
39- resize : vertical ;
40- min-height : 80px ;
41- color : var (--primary-dark );
42- }
43- </style >
5+
6+ <details class ="context-details" bind:open ={expanded }>
7+ <summary >add more context</summary >
8+ <textarea
9+ class =" context-input"
10+ rows =" 4"
11+ bind:value ={additionalContext }
12+ placeholder =" anything else we should know about?"
13+ ></textarea >
14+ {#if additionalContext .trim () !== ' ' }
15+ <div class =" button-container" >
16+ <button
17+ type =" button"
18+ class =" clear-button"
19+ onclick ={() => {
20+ additionalContext = ' '
21+ }}
22+ >
23+ clear
24+ </button >
25+ </div >
26+ {/if }
27+ </details >
28+
29+ <style >
30+ details .context-details {
31+ text-align : left ;
32+ border : 1px solid var (--light );
33+ background-color : var (--white );
34+ border-radius : var (--border-radius );
35+ padding : 1rem ;
36+ margin-bottom : 1rem ;
37+ box-shadow : 0 2px 4px rgba (0 , 0 , 0 , 0.05 );
38+ }
39+
40+ details summary {
41+ cursor : pointer ;
42+ font-weight : 500 ;
43+ }
44+
45+ textarea .context-input {
46+ font-family : var (--label-font );
47+ width : 100% ;
48+ margin-top : 0.75rem ;
49+ padding : 0.75rem ;
50+ border : 1px solid var (--light );
51+ border-radius : var (--border-radius );
52+ resize : vertical ;
53+ min-height : 80px ;
54+ color : var (--primary-dark );
55+ }
56+
57+ .clear-button {
58+ border : none ;
59+ background-color : var (--light );
60+ color : var (--primary-dark );
61+ border-radius : var (--border-radius );
62+ padding : 0.25rem 0.75rem ;
63+ cursor : pointer ;
64+ }
65+
66+ .clear-button :hover {
67+ background-color : var (--primary-dark );
68+ color : var (--white );
69+ }
70+
71+ .button-container {
72+ display : flex ;
73+ justify-content : flex-end ;
74+ margin-top : 0.5rem ;
75+ }
76+ </style >
77+
0 commit comments