Advertisement
iko1133

Untitled

Nov 29th, 2024
9
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 KB | None | 0 0
  1. import { useSortable } from "@dnd-kit/sortable";
  2. import { Arrow } from "../../assets/icons/Arrow";
  3. import { Handle } from "../../assets/icons/Handle";
  4. import { Input } from "../ui/input";
  5. import { Label } from "../ui/label";
  6. import { CSS } from "@dnd-kit/utilities";
  7. import { Trash } from "lucide-react";
  8.  
  9. interface SingleFormProps {
  10. hasArrow?: boolean;
  11. style?: React.CSSProperties;
  12. id: string;
  13. onRemove: (id: string) => void;
  14. removeEnabled?: boolean;
  15. }
  16.  
  17. const SingleForm = ({
  18. hasArrow = true,
  19. style: containerStyle,
  20. id,
  21. onRemove,
  22. removeEnabled = true,
  23. ...props
  24. }: SingleFormProps) => {
  25. const { attributes, listeners, setNodeRef, transform, transition } =
  26. useSortable({ id });
  27.  
  28. const onRemoveClick = () => onRemove(id);
  29.  
  30. const style = {
  31. transform: CSS.Transform.toString(transform),
  32. transition,
  33. };
  34.  
  35. return (
  36. <div
  37. className="flex flex-col mt-4 bg-white"
  38. ref={setNodeRef}
  39. style={{
  40. ...containerStyle,
  41. ...style,
  42. borderBottomWidth: 1,
  43. borderBottomColor: "#E2E8F0",
  44. }}
  45. {...attributes}
  46. >
  47. {hasArrow && <Arrow className="self-center mb-4" />}
  48.  
  49. <div className="flex flex-row">
  50. <Handle className="mr-6 self-center" {...listeners} />
  51.  
  52. <div className="flex flex-col w-full pr-2">
  53. {removeEnabled && (
  54. <Trash className="self-end mb-4 z-50" onClick={onRemoveClick} />
  55. )}
  56.  
  57. <div className="flex flex-row justify-between items-center mb-11">
  58. <Input className="h-12 font-semibold text-2xl" />
  59. <div className="mr-2 ml-2 font-semibold size text-2xl">-</div>
  60. <Input className="h-12 font-semibold text-2xl" />
  61. </div>
  62.  
  63. <div className="flex flex-row justify-between mb-6">
  64. <div className="flex flex-col flex-1">
  65. <Label htmlFor="ПРЕВОЗНИК" className="mb-2 text-sm font-medium ">
  66. ПРЕВОЗНИК
  67. </Label>
  68. <Input className="h-9 mb-3" />
  69.  
  70. <Label htmlFor="Адреса" className="mb-2 text-sm font-medium ">
  71. Адреса
  72. </Label>
  73. <Input className="h-9 mb-3" />
  74.  
  75. <Label htmlFor="ПИБ" className="mb-2 text-sm font-medium ">
  76. ПИБ
  77. </Label>
  78. <Input className="h-9 mb-3" />
  79. </div>
  80. <div className="w-7" />
  81. <div className="flex flex-col flex-1">
  82. <Label htmlFor="Возач" className="mb-2 text-sm font-medium ">
  83. Возач
  84. </Label>
  85. <Input className="h-9 mb-3" />
  86.  
  87. <Label
  88. htmlFor="Регистарски број возила"
  89. className="mb-2 text-sm font-medium "
  90. >
  91. Регистарски број возила
  92. </Label>
  93. <Input className="h-9 mb-3" />
  94.  
  95. <Label htmlFor="Имејл" className="mb-2 text-sm font-medium ">
  96. Имејл
  97. </Label>
  98. <Input className="h-9 mb-3" />
  99.  
  100. <Label htmlFor="Telefon" className="mb-2 text-sm font-medium ">
  101. Telefon
  102. </Label>
  103. <Input className="h-9 mb-3" />
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. );
  110. };
  111.  
  112. export default SingleForm;
  113.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement