property-practice-ui 0.0.13 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "property-practice-ui",
3
- "version": "0.0.13",
3
+ "version": "0.1.1",
4
4
  "description": "",
5
5
  "private": false,
6
6
  "type": "module",
@@ -1,25 +1,19 @@
1
- 'use client';
2
-
3
- import { useState } from 'react';
4
1
  import { Option } from '../../types';
5
2
 
6
3
  interface TabsProps <T>{
7
- defaultTab: T;
8
- onTabChange?: (tab: T) => void;
4
+ value: T
5
+ onTabChange: (tab: T) => void;
9
6
  options: Option<T>[]
10
7
  }
11
8
 
12
9
  export const Tabs = <T extends string | number>({
13
- defaultTab,
10
+ value: tabValue,
14
11
  onTabChange,
15
12
  options
16
13
  }: TabsProps<T>) => {
17
- const [tab, setTab] = useState<T>(defaultTab);
18
-
19
14
 
20
15
  const handleTabChange = (newTab: T) => {
21
- setTab(newTab);
22
- onTabChange?.(newTab);
16
+ onTabChange(newTab);
23
17
  };
24
18
 
25
19
  return (
@@ -32,7 +26,7 @@ export const Tabs = <T extends string | number>({
32
26
  type="button"
33
27
  onClick={() => handleTabChange(value)}
34
28
  className={`text-base font-semibold cursor-pointer px-6 py-2 rounded-t-lg border-b-4 transition-colors duration-200 ${
35
- tab === value
29
+ tabValue === value
36
30
  ? 'border-blue-600 text-[#033c89]'
37
31
  : 'border-transparent text-gray-400 dark:text-[#033c89]'
38
32
  }`}