import getConfig from "next/config";
import React from "react";

import { useStoreState } from "../store";
import AppWrapper from "../components/AppWrapper";
import { Col } from "../components/Layout";
import Footer from "../components/Footer";

const { publicRuntimeConfig } = getConfig();

const TermsPage = () => {
  const { isAuthenticated } = useStoreState(s => s.auth);
  return (
    <AppWrapper>
    {/* TODO: better container */}
    {isAuthenticated && <Col width={600} maxWidth="97%" alignItems="flex-start">
      <h3>{publicRuntimeConfig.SITE_NAME} Terms of Service Agreement</h3>
      <p> <strong>1. Acceptance of Terms:</strong> This URL shortening service (the "Service") is the property of the Sanger Unified School District ("SUSD") and is provided exclusively for use by its active employees ("Users"). </p>
      <p> By accessing or using this Service, you acknowledge that you are an active SUSD employee and you hereby agree to be legally bound by these Terms of Service (the "Terms"), as well as all applicable laws, regulations, and SUSD administrative regulations or board policies. You are responsible for ensuring your compliance with all applicable policies. If you do not agree with any of these Terms, you are strictly prohibited from using or accessing this Service. </p>
      <p> <strong>2. Acceptable Use and User Responsibility:</strong> As a User of this SUSD-owned Service, you are solely responsible for the content and materials of any website you link to using the Service (the "Destination Site"). </p>
      <p> You agree not to use the Service to link to any Destination Site that contains malicious code, promotes illegal activity, or includes content that is obscene, discriminatory, defamatory, harassing, or otherwise violates the integrity, values, or policies of SUSD. You are responsible for verifying the safety and appropriateness of all Destination Sites to ensure they are suitable for the intended public or internal community. </p>
      <p> <strong>3. Disclaimer:</strong> Network Content Filtering: You acknowledge that SUSD maintains a content filter ("Filter") on its network that may block access to certain Destination Sites. The Service only generates a URL and has no control over the Filter. </p>
      <p> Any "blocked" message or access issue is a result of the Filter's rules being applied to the Destination Site, not the short link generated by this Service. It is your responsibility to confirm whether a Destination Site is accessible on the SUSD network prior to creating and distributing a short link to an SUSD-network-based audience. </p>
      <p> To request that a Destination Site be reviewed or unblocked, you must follow the official District procedure by contacting your supervisor or area administrator. Please gauge your target audience (internal vs. external) before submitting unblock requests, as a site blocked on the SUSD network may function normally for audiences outside the SUSD network. </p>

      <p><strong>Your Sanger Unified Employment Status</strong></p>
      <p> Access to this URL shortening service (the "Service") is strictly contingent upon your active employment status with SUSD. </p>
      <p> Upon the termination or separation of your employment with SUSD, for any reason, your authorization to access and use this Service is immediately and automatically revoked. Any continued use of this Service post-employment constitutes unauthorized access and is strictly prohibited. </p>
      <p> Following your separation, you are directed to permanently delete your account. This can be accomplished by navigating to the 'Settings' panel and completing the 'Delete Account' process. If you are unable to complete the deletion, your obligation to cease all use of the Service remains in full effect. </p>
      <p> Should you require assistance with the account deletion process, please contact webmaster@sangerusd.net. </p>
      ---
      <p>
        {publicRuntimeConfig.SITE_NAME} may revise these terms of service for
        its website at any time without notice. By using this website, you are
        agreeing to be bound by the then current version of these terms of
        service.
      </p>
    </Col>}
    {!isAuthenticated && <Col width={600} maxWidth="97%" alignItems="flex-start">
      <h3>{publicRuntimeConfig.SITE_NAME} General Terms & Conditions</h3>
      <p>
    <strong>1. Binding Agreement and Compliance</strong>
  </p>
  <p>
    By accessing the website at{" "}
    <a href={`https://${publicRuntimeConfig.DEFAULT_DOMAIN}`}>
      https://{publicRuntimeConfig.DEFAULT_DOMAIN}
    </a>
    (the "Service"), you hereby agree to be unequivocally bound by these
    Terms of Service (the "Terms"), all applicable laws and regulations,
    and all Sanger Unified School District (SUSD) administrative
    regulations and board policies. You affirm that you are solely
    responsible for compliance with any applicable local, state, and
    federal laws. If you do not agree with any of these Terms, you are
    strictly prohibited from using or accessing this Service. The materials
    contained in this Service are protected by applicable copyright and
    trademark law.
  </p>

  <p>
    <strong>2. DISCLAIMER AND LIMITATION OF LIABILITY</strong>
  </p>
  <p>
    THE MATERIALS AND FUNCTIONALITY ON THIS SERVICE ARE PROVIDED "AS IS".
    IN NO EVENT SHALL {publicRuntimeConfig.SITE_NAME}, THE SANGER
    UNIFIED SCHOOL DISTRICT (SUSD), OR ITS SUPPLIERS, AGENTS, OFFICERS,
    TRUSTEES, OR EMPLOYEES BE LIABLE FOR ANY DAMAGES (INCLUDING,
    WITHOUT LIMITATION, DAMAGES FOR LOSS OF DATA OR PROFIT, OR DUE TO
    BUSINESS INTERRUPTION) ARISING OUT OF THE USE, OR INABILITY TO
    USE, THE MATERIALS OR FUNCTIONALITY OF THE SERVICE, EVEN IF{" "}
    {publicRuntimeConfig.SITE_NAME} OR AN AUTHORIZED REPRESENTATIVE HAS
    BEEN NOTIFIED ORALLY OR IN WRITING OF THE POSSIBILITY OF SUCH
    DAMAGE.
  </p>
  <p>
    BECAUSE SOME JURISDICTIONS DO NOT ALLOW LIMITATIONS ON IMPLIED
    WARRANTIES, OR LIMITATIONS OF LIABILITY FOR CONSEQUENTIAL OR
    INCIDENTAL DAMAGES, THESE LIMITATIONS MAY NOT APPLY TO YOU.
  </p>

  <p>
    <strong>3. Disclaimer of Warranties (Content Accuracy)</strong>
  </p>
  <p>
    The materials appearing on {publicRuntimeConfig.SITE_NAME}'s website
    could include technical, typographical, or photographic errors.{" "}
    {publicRuntimeConfig.SITE_NAME} does not warrant or make any
    representations concerning the accuracy, completeness, or currency of
    the materials on its Service. {publicRuntimeConfig.SITE_NAME} reserves
    the right to make changes to the materials contained on its website
    at any time without notice, but makes no commitment to update said
    materials.
  </p>

  <p>
    <strong>4. Third-Party Links and Content</strong>
  </p>
  <p>
    {publicRuntimeConfig.SITE_NAME} has not reviewed all of the
    third-party sites linked to from its Service and is not responsible
    for the contents, safety, or availability of any such linked site. The
    inclusion of any link does not imply endorsement, approval, or
    control by {publicRuntimeConfig.SITE_NAME} or SUSD of the site. Use
    of any such linked website is entirely at the user's own risk, and
    you agree to hold {publicRuntimeConfig.SITE_NAME} and SUSD harmless
    from any liability arising from your use of such links.
  </p>

  <p>
    <strong>5. Modification of Terms</strong>
  </p>
  <p>
    {publicRuntimeConfig.SITE_NAME} reserves the right to revise these
    Terms of Service for its website at any time, without notice. By
    using this Service, you are agreeing to be bound by the
    then-current version of these Terms. It is your responsibility to
    review these Terms periodically for changes.
  </p>
    </Col>}
    {<Footer />}
  </AppWrapper>
)};

export default TermsPage;
