You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

line.tsx 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. 'use client'
  2. import useTheme from '@/hooks/use-theme'
  3. type LineProps = {
  4. className?: string
  5. }
  6. const Line = ({
  7. className,
  8. }: LineProps) => {
  9. const { theme } = useTheme()
  10. const isDarkMode = theme === 'dark'
  11. if (isDarkMode) {
  12. return (
  13. <svg xmlns='http://www.w3.org/2000/svg' width='2' height='240' viewBox='0 0 2 240' fill='none' className={className}>
  14. <path d='M1 0L1 240' stroke='url(#paint0_linear_6295_52176)' />
  15. <defs>
  16. <linearGradient id='paint0_linear_6295_52176' x1='-7.99584' y1='240' x2='-7.88094' y2='3.95539e-05' gradientUnits='userSpaceOnUse'>
  17. <stop stopOpacity='0.01' />
  18. <stop offset='0.503965' stopColor='#C8CEDA' stopOpacity='0.14' />
  19. <stop offset='1' stopOpacity='0.01' />
  20. </linearGradient>
  21. </defs>
  22. </svg>
  23. )
  24. }
  25. return (
  26. <svg xmlns='http://www.w3.org/2000/svg' width='2' height='241' viewBox='0 0 2 241' fill='none' className={className}>
  27. <path d='M1 0.5L1 240.5' stroke='url(#paint0_linear_1989_74474)' />
  28. <defs>
  29. <linearGradient id='paint0_linear_1989_74474' x1='-7.99584' y1='240.5' x2='-7.88094' y2='0.50004' gradientUnits='userSpaceOnUse'>
  30. <stop stopColor='white' stopOpacity='0.01' />
  31. <stop offset='0.503965' stopColor='#101828' stopOpacity='0.08' />
  32. <stop offset='1' stopColor='white' stopOpacity='0.01' />
  33. </linearGradient>
  34. </defs>
  35. </svg>
  36. )
  37. }
  38. export default Line