web_lib

Common web application libraries
git clone https://radroots.dev/git/web_lib.git
Log | Files | Refs | LICENSE

farms-add-detail.svelte (2930B)


      1 <script lang="ts">
      2     import FormLineLedger from "$lib/components/form/form-line-ledger.svelte";
      3     import type { LibContext } from "$lib/types/context";
      4     import { get_context } from "@radroots/apps-lib";
      5 
      6     const { ls } = get_context<LibContext>(`lib`);
      7 
      8     let {
      9         val_farmname = $bindable(``),
     10         val_farmaddress = $bindable(``),
     11         val_farmabout = $bindable(``),
     12         val_farmwebsite = $bindable(``),
     13         farm_geop_lat,
     14         farm_geop_lng,
     15     }: {
     16         val_farmname: string;
     17         val_farmaddress: string;
     18         val_farmabout: string;
     19         val_farmwebsite: string;
     20         farm_geop_lat: string;
     21         farm_geop_lng: string;
     22     } = $props();
     23 </script>
     24 
     25 <div
     26     class={`flex flex-col h-[100vh] w-full px-6 pt-2 gap-4 justify-start items-center`}
     27 >
     28     <FormLineLedger
     29         bind:value={val_farmaddress}
     30         basis={{
     31             id: `farm_location`,
     32             label: `${$ls(`common.farm_location`)}`,
     33             input: {
     34                 placeholder: `${$ls(`icu.enter_*`, {
     35                     value: `${$ls(`common.farm_location`)}`.toLowerCase(),
     36                 })}`,
     37             },
     38         }}
     39     />
     40 
     41     <FormLineLedger
     42         basis={{
     43             id: `farm_coordinates`,
     44             label: `${$ls(`common.farm_coordinates`)}`,
     45             display_value:
     46                 farm_geop_lat && farm_geop_lng
     47                     ? `${farm_geop_lat}, ${farm_geop_lng}`
     48                     : undefined,
     49             input:
     50                 farm_geop_lat && farm_geop_lng
     51                     ? undefined
     52                     : {
     53                           placeholder: `${$ls(`icu.enter_*`, {
     54                               value: `${$ls(
     55                                   `common.farm_coordinates`,
     56                               )}`.toLowerCase(),
     57                           })}`,
     58                       },
     59         }}
     60     />
     61     <FormLineLedger
     62         bind:value={val_farmname}
     63         basis={{
     64             id: `farm_name`,
     65             label: `${$ls(`common.farm_name`)}`,
     66             input: {
     67                 placeholder: `${$ls(`icu.enter_*`, {
     68                     value: `${$ls(`common.farm_name`)}`.toLowerCase(),
     69                 })}`,
     70             },
     71         }}
     72     />
     73     <FormLineLedger
     74         bind:value={val_farmabout}
     75         basis={{
     76             id: `farm_about`,
     77             label: `${$ls(`common.about`)}`,
     78             input: {
     79                 placeholder: `${`${$ls(`icu.enter_*`, {
     80                     value: `${$ls(`common.about`)}`.toLowerCase(),
     81                 })}`}`,
     82             },
     83         }}
     84     />
     85     <FormLineLedger
     86         bind:value={val_farmwebsite}
     87         basis={{
     88             id: `farm_website`,
     89             label: `${$ls(`common.website`)}`,
     90             input: {
     91                 placeholder: `${$ls(`icu.enter_*`, {
     92                     value: `${$ls(`common.website`)}`.toLowerCase(),
     93                 })}`,
     94             },
     95         }}
     96     />
     97 </div>